Client Libraries
Danube provides official client libraries for four languages. All clients follow the same builder pattern and support the full feature set.
Supported Languages
Section titled “Supported Languages”Context-based client with gRPC transport.
go get github.com/danube-messaging/danube-goJava 21+ with virtual threads and reactive Flow.Publisher API.
implementation 'com.danube-messaging:danube-client:0.4.0'<dependency> <groupId>com.danube-messaging</groupId> <artifactId>danube-client</artifactId> <version>0.4.0</version></dependency>Feature Matrix
Section titled “Feature Matrix”| Feature | Rust | Go | Java | Python |
|---|---|---|---|---|
| Producers & Consumers | ✅ | ✅ | ✅ | ✅ |
| Partitioned Topics | ✅ | ✅ | ✅ | ✅ |
| Reliable Dispatch | ✅ | ✅ | ✅ | ✅ |
| Exclusive Subscription | ✅ | ✅ | ✅ | ✅ |
| Shared Subscription | ✅ | ✅ | ✅ | ✅ |
| Failover Subscription | ✅ | ✅ | ✅ | ✅ |
| Key-Shared Subscription | ✅ | ✅ | ✅ | ✅ |
| JSON Schema | ✅ | ✅ | ✅ | ✅ |
| Avro | ✅ | ✅ | ✅ | ✅ |
| Protobuf | ✅ | ✅ | ✅ | ✅ |
| TLS / mTLS | ✅ | ✅ | ✅ | ✅ |
| JWT Authentication | ✅ | ✅ | ✅ | ✅ |
API Pattern
Section titled “API Pattern”All four clients use the same builder pattern. The API surface is intentionally consistent across languages:
// Clientlet client = DanubeClient::builder() .service_url("http://127.0.0.1:6650") .build() .await?;
// Producerlet mut producer = client.new_producer() .with_topic("/default/my-topic") .with_name("my-producer") .build()?;
// Consumerlet mut consumer = client.new_consumer() .with_topic("/default/my-topic") .with_consumer_name("my-consumer") .with_subscription("my-sub") .with_subscription_type(SubType::Exclusive) .build()?;// Clientclient, _ := danube.NewClient().ServiceURL("127.0.0.1:6650").Build()
// Producerproducer, _ := client.NewProducer(). WithTopic("/default/my-topic"). WithName("my-producer"). Build()
// Consumerconsumer, _ := client.NewConsumer(). WithTopic("/default/my-topic"). WithConsumerName("my-consumer"). WithSubscription("my-sub"). WithSubscriptionType(danube.Exclusive). Build()// ClientDanubeClient client = DanubeClient.builder() .serviceUrl("http://127.0.0.1:6650") .build();
// ProducerProducer producer = client.newProducer() .withTopic("/default/my-topic") .withName("my-producer") .build();
// ConsumerConsumer consumer = client.newConsumer() .withTopic("/default/my-topic") .withConsumerName("my-consumer") .withSubscription("my-sub") .withSubscriptionType(SubType.EXCLUSIVE) .build();# Clientclient = await DanubeClientBuilder().service_url("http://127.0.0.1:6650").build()
# Producerproducer = client.new_producer() \ .with_topic("/default/my-topic") \ .with_name("my-producer") \ .build()
# Consumerconsumer = client.new_consumer() \ .with_topic("/default/my-topic") \ .with_consumer_name("my-consumer") \ .with_subscription("my-sub") \ .with_subscription_type(SubType.EXCLUSIVE) \ .build()Next Steps
Section titled “Next Steps”- Setup & Connection: TLS, JWT authentication, token rotation
- Producer Guide: Sending messages, partitions, reliable dispatch
- Consumer Guide: Receiving messages, ack/nack, subscription types
- Schema Registry: Type-safe messaging with validation