commit | 1d3d8fdb969bf082c8130447c7603ade9f4c5c8d | [log] [tgz] |
---|---|---|
author | Daniel Blankensteiner <db@vmail.dk> | Fri Jan 28 12:01:27 2022 +0100 |
committer | Daniel Blankensteiner <db@vmail.dk> | Fri Jan 28 12:01:27 2022 +0100 |
tree | 7acdb36cce7f291d0dfbd96ba166fa0fae271f1f | |
parent | 860edcd410a6c0c8c684e5a3234b10f1022d7840 [diff] |
Creating an IAuthentication interface and an AuthenticationFactory to be more aligned with the other clients and with the way exception handling is implemented. We have an issue (at least locally) with the standalone clusters used for tests. We get an "org.apache.pulsar.broker.web.RestException: Policies not found for public/default namespace" about 50% of the time using docker-compose-standalone-tests.yml and always using docker-compose-standalone-token-tests.yml
# DotPulsar
The official .NET client library for Apache Pulsar.
DotPulsar is written entirely in C# and implements Apache Pulsar's binary protocol.
Have a look at the changelog.
Let's take a look at a “Hello world” example, where we first produce a message and then consume it.
First, we need a Pulsar setup. Have a look here to see how to setup a local standalone Pulsar instance. Install the NuGet package DotPulsar and copy/paste the code below (you will be needing using declarations for ‘DotPulsar’ and ‘DotPulsar.Extensions’).
const string myTopic = "persistent://public/default/mytopic"; await using var client = PulsarClient.Builder() .Build(); //Connecting to pulsar://localhost:6650 var producer = client.NewProducer() .Topic(myTopic) .Create(); _ = await producer.Send(Encoding.UTF8.GetBytes("Hello World")); var consumer = client.NewConsumer() .SubscriptionName("MySubscription") .Topic(myTopic) .Create(); await foreach (var message in consumer.Messages()) { Console.WriteLine("Received: " + Encoding.UTF8.GetString(message.Data.ToArray())); await consumer.Acknowledge(message); }
For a more in-depth tour of the API, please visit the Wiki.
Help prioritizing the roadmap is most welcome, so please reach out and tell us what you want and need.
Apache Pulsar has a Slack instance and there you'll find us in the #dev-dotpulsar channel. Just waiting for you to pop by :-)
We use SemVer for versioning. For the versions available, see the tags on this repository.
See also the list of contributors who participated in this project.
This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.