Search code examples
asynchronousapache-pulsar

Producing C# Messages Asynchronously


We have started using Pulsar on our current project, and overall we're liking it.

Unfortunately, it appears that the current DotPulsar (.NET client) does not support .SendAsync() calls.

This is a HUGE issue!

Does anyone know a way to produce messages asynchronously in C#?

We're basically following the documentation:

https://pulsar.apache.org/docs/3.0.x/client-libraries-producers/

where is mentions the .sendAsync() method in passing. Upon investigating the DotPulsar source code, it appears that the method has not been implemented.


Solution

  • Look at the C# example of the Send() method. It is asynchronous.

    var data = Encoding.UTF8.GetBytes("Hello World");
    await producer.Send(data);