【问题标题】:Apache Pulsar: application using DotPulsarApache Pulsar:使用 DotPulsar 的应用程序
【发布时间】:2021-11-10 07:22:41
【问题描述】:

我构建了一个小型 NET Core 应用程序来测试 Pulsar。我正在尝试重复此处描述的步骤https://pulsar.apache.org/docs/en/client-libraries-dotnet/ 我已经添加了 NuGet DotPulsar。

而且我在编译过程中遇到了错误。 例如, var data = Encoding.UTF8.GetBytes("Hello World"); var messageId = 等待 pulsarProducer.NewMessage() .Property("SomeKey", "SomeValue") .发送(数据);

IProducer 不包含 NewMessage() 等的定义。如何解决?

【问题讨论】:

    标签: .net-core apache-pulsar


    【解决方案1】:

    IProducer 上的 'NewMessage' 方法实际上是一个扩展方法,所以你需要一个 'DotPulsar.Extensions' 的 using 语句。

    最好的问候 分贝

    【讨论】:

      猜你喜欢
      • 2020-10-12
      • 2022-06-26
      • 2020-10-08
      • 2020-10-12
      • 2018-12-04
      • 2018-11-22
      • 2019-11-19
      • 2020-04-10
      • 2020-07-02
      相关资源
      最近更新 更多