Giter Site home page Giter Site logo

pulsar-dotpulsar's Introduction

DotPulsar

CI - Unit

.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.

Getting Started

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.

Supported features

  • Service discovery
  • Automatic reconnect
  • TLS connections
  • TLS Authentication
  • JSON Web Token Authentication
  • Producer send with custom metadata
  • Producer send with event time, sequence id and delayed message delivery
  • Producer send with key and ordering key
  • Consumer subscription with initial position and priority level
  • Consumer subscription types exclusive, shared, failover and key shared
  • Consumer receive and single + cumulative acknowledge
  • Consumer seek
  • Consumer unsubscribe
  • Consume compacted topics
  • Reader API
  • Read/Consume/Acknowledge batched messages
  • Pulsar Proxy

Roadmap

Help prioritizing the roadmap is most welcome, so please reach out and tell us what you want and need.

1.0.0

We are feature complete for this release. We just need testing.

  • Use IAsyncDisposable
  • Use IAsyncEnumerable
  • Use ValueTask instead of Task
  • Make solution nullable
  • Support .NET Standard 2.0 and 2.1

If requested by the community

Let us know which features you need by creating an issue or by giving existing issues a "Thumbs up".

Join Our Community

Apache Pulsar has a Slack instance and there you'll find us in the #dev-dotpulsar channel. Just waiting for you to pop by :-)

Built With

  • protobuf-net - Provides simple access to fast and efficient "Protocol Buffers" serialization from .NET applications
  • System.IO.Pipelines - Single producer single consumer byte buffer management

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the Apache License Version 2.0 - see the LICENSE file for details.

pulsar-dotpulsar's People

Contributors

blankensteiner avatar ragingkore avatar vp89 avatar sijie avatar janpieterz avatar mhelleborg avatar robertindie avatar chickenzilla avatar dionjansen avatar usaguerrilla avatar lee-chrisbell avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.