GithubHelp home page GithubHelp logo

entvex / pulsar-dotpulsar Goto Github PK

View Code? Open in Web Editor NEW

This project forked from apache/pulsar-dotpulsar

0.0 0.0 0.0 2.36 MB

The official .NET client library for Apache Pulsar

Home Page: https://pulsar.apache.org/

License: Apache License 2.0

C# 100.00%

pulsar-dotpulsar's Introduction

DotPulsar

CI - Unit

The official .NET client library for Apache Pulsar.

DotPulsar is written entirely in C# and implements Apache Pulsar's binary protocol.

What's new?

Have a look at the changelog.

Getting Started

Let's take a look at a "Hello world" example, where we first produce a message and then consume it. Note that the topic and subscription will be created if they don't exist.

First, we need a Pulsar setup. See Pulsar docs for how to set up a local standalone Pulsar instance.

Install the NuGet package DotPulsar and run the follow code example:

using DotPulsar;
using DotPulsar.Extensions;

const string myTopic = "persistent://public/default/mytopic";

// connecting to pulsar://localhost:6650
await using var client = PulsarClient.Builder().Build();

// produce a message
await using var producer = client.NewProducer(Schema.String).Topic(myTopic).Create();
await producer.Send("Hello World");

// consume messages
await using var consumer = client.NewConsumer(Schema.String)
    .SubscriptionName("MySubscription")
    .Topic(myTopic)
    .InitialPosition(SubscriptionInitialPosition.Earliest)
    .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.

Supported features

  • Service discovery
  • Automatic reconnect
  • TLS connections
  • Pulsar Proxy
  • Producer - send with custom metadata
  • Producer - send with event time, sequence id, and delayed message delivery
  • Producer - send with key and ordering key
  • Producer - partitioned topics
  • Consumer - subscription with initial position and priority level
  • Consumer - subscription types exclusive, shared, failover, and key shared
  • Consumer - receive and single + cumulative acknowledge
  • Consumer/Reader - seek on message-id and publish time
  • Consumer - unsubscribe
  • Consumer - compacted topics
  • Consumer - partitioned topics
  • Reader API
  • Read/Consume/Acknowledge batched messages
  • Telemetry
  • Authentication
    • TLS Authentication
    • JSON Web Token Authentication
    • Custom Authentication
  • Message compression
    • LZ4
    • ZLIB
    • ZSTD
    • SNAPPY
  • Schemas
    • Boolean
    • Bytes (using byte[] and ReadOnlySequence<byte>)
    • String (UTF-8, UTF-16, and US-ASCII)
    • INT8, INT16, INT32, and INT64
    • Float and Double
    • Time (using TimeSpan)
    • Timestamp and Date (using DateTime)

For a horizontal comparison with more language-specific clients, see Client Feature Matrix.

Roadmap

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

Join Our Community

Apache Pulsar has a Slack instance, and there you'll find us in the #dev-dotpulsar channel.

Versioning

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

Authors

Contributions are welcomed and greatly appreciated. See also the list of contributors who participated in this project. Read the CONTRIBUTING guide for how to participate.

If your contribution adds Pulsar features for C# clients, you need to update both the Pulsar docs and the Client Feature Matrix. See Contribution Guide for more details.

License

This project is licensed under Apache License, Version 2.0.

pulsar-dotpulsar's People

Contributors

aintjoshinya avatar blankensteiner avatar chickenzilla avatar dionjansen avatar entvex avatar gfoidl avatar goldenccargill avatar hsa-dc avatar janpieterz avatar jvmdc avatar kandersen82 avatar lee-chrisbell avatar lhotari avatar mhelleborg avatar michaeljmarshall avatar momo-jun avatar mortenkj avatar ragingkore avatar robertindie avatar sijie avatar tisonkun avatar toneill818 avatar usaguerrilla avatar vp89 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.