commit | 02ad325b9a8f932e08ad96c2f40448b7bf0ace0a | [log] [tgz] |
---|---|---|
author | Kristian Andersen <kandersen82@users.noreply.github.com> | Wed Apr 20 12:50:11 2022 +0200 |
committer | GitHub <noreply@github.com> | Wed Apr 20 12:50:11 2022 +0200 |
tree | e2c40f83fa8e7043ecca21c95f996b8d18e3368d | |
parent | 20f46b30bfbd1d07cd7dd3cc0f687f6478393ba3 [diff] |
Performance tuning PulsarStream (#103) Use ReadAtLeast to wait until a usable amount of data is ready.
# 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 await using var producer = client.NewProducer(Schema.String) .Topic(myTopic) .Create(); _ = await producer.Send("Hello World"); // Send a message and ignore the returned MessageId await using var consumer = client.NewConsumer(Schema.String) .SubscriptionName("MySubscription") .Topic(myTopic) .Create(); await foreach (var message in consumer.Messages()) { Console.WriteLine($"Received: {message.Value()}"); 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.
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.