commit | ffe13ecc57aa207c9ab968130d42ef682ca0f191 | [log] [tgz] |
---|---|---|
author | Daniel Blankensteiner <dba@danskecommodities.com> | Mon Sep 23 10:09:36 2019 +0200 |
committer | Daniel Blankensteiner <dba@danskecommodities.com> | Mon Sep 23 10:09:36 2019 +0200 |
tree | d6089595431e71c7bd221f125ae9980158d36610 | |
parent | 24e763cc7446171f358c7634e2c7a23927ec7eec [diff] |
Add token authentication and fault producer/consumer/reader when host/network is unknown/unreachable.
Native .NET/C# client library for Apache Pulsar.
DotPulsar is written entirely in C# and implements Apache Pulsar's binary protocol. Other options was using the C++ client library (which is what the Python client and Go client do) or build on top of the WebSocket API. We decided to implement the binary protocol to gain full control and maximize portability and performance.
DotPulsar‘s API is strongly inspired by Apache Pulsar’s official Java client, but a 100% match is not a goal.
Let's take a look at a “Hello world” example, where we first produce a message and then consume it.
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"; using var client = PulsarClient.Builder().Build(); //Connecting to 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(); var message = await consumer.Receive(); 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.
Before the first stable release, we should have a look at:
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.