commit | 17f95aa1c9c0b264031f8e0a9639842082ddd739 | [log] [tgz] |
---|---|---|
author | Dion Jansen <dionjansen@wlnss.com> | Sun Jun 28 18:37:31 2020 +0200 |
committer | GitHub <noreply@github.com> | Sun Jun 28 18:37:31 2020 +0200 |
tree | f468d5a183c3fc5c12324985fb0eb112d5a8903c | |
parent | 9441ce5ddf87ef4458e8e0416c12a2e8d9eb04d2 [diff] |
Redeliver unacknowledged messages (#47) * Dockerise samples * Added basecommand extension for RedeliverUnacknowledgedMessages * Added send overloads to IConsumerChannel and IConnection for CommandRedeliverUnacknowledgedMessages * Connection impelmentation * Added implementation for Send CommandRedeliverUnacknowledgedMessages in consumerchannel * Implementation for Send CommandRedeliverUnacknowledgedMessages in NotReadyChannel * Added public API for RedeliverUnacknowledgedMessages with given message Ids or none * Reverted changes to samples * Indent * IEnumerable for consumer API * Use IEnumerable in consumer impl * New enumerable empty rather than list * ConfigureAwait's for Consumer.RedeliverUnacknowledgedMessages
# DotPulsar
.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"; 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.
We are feature complete for this release. We just need testing.
Let us know which features you need by creating an issue or by giving existing issues a “Thumbs up”.
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.