Silverback
Simplicity at its core. Flexibility at its peak. Effortless messaging for .NET.
A message bus and broker integration library to build event-driven architectures with first-class support for Apache Kafka and MQTT.
dotnet add package Silverback.Integration.Kafka
Produce and Consume in a Few Lines
Configure the broker connection, the producer and consumer endpoints, and a subscriber. Silverback takes care of serialization, headers, error handling and delivery.
services.AddSilverback()
.WithConnectionToMessageBroker(options => options.AddKafka())
.AddKafkaClients(clients => clients
.WithBootstrapServers("PLAINTEXT://localhost:9092")
.AddProducer(producer => producer
.Produce<OrderCreated>(endpoint => endpoint
.ProduceTo("orders")))
.AddConsumer(consumer => consumer
.WithGroupId("billing")
.Consume<OrderCreated>(endpoint => endpoint
.ConsumeFrom("orders")
.OnError(policy => policy.Retry(3).ThenSkip()))))
.AddSingletonSubscriber<OrderCreatedHandler>();
// Publish: the message is routed to the "orders" topic
await publisher.PublishAsync(new OrderCreated(orderId));
// Consume: the subscriber is invoked for each consumed message
public class OrderCreatedHandler
{
public Task HandleAsync(OrderCreated message) => ...;
}
Why Silverback
A consistent, fluent API for Kafka and MQTT that still surfaces partitions, keys, tombstones and transactions.
Reliable by DesignTransactional outbox, error policies (retry, skip, move) and storage-backed offsets and locks.
Built for ThroughputPartition-based parallelism, batch processing, streaming and chunking of large payloads.
Cross-Cutting FeaturesSerialization, Schema Registry (JSON, Avro, Protobuf), headers, validation and end-to-end encryption.
ObservableStructured logging, distributed tracing via System.Diagnostics and health checks.
In-memory Kafka and MQTT brokers and testing helpers for fast and reliable end-to-end tests.
Explore the Documentation
Produce and consume via Kafka in five minutes.
Setting Up SilverbackPackages, registration and configuration basics.
Using the Message BusPublish and subscribe in-process, behaviors and return values.
Producing MessagesEndpoints, routing, headers, outbox and Kafka specifics.
Consuming MessagesSubscribers, parallelism, batches and error handling.
SamplesRunnable Kafka and MQTT examples.
Migrating from v4Step-by-step upgrade guide to Silverback 5.
FAQ and TroubleshootingAnswers to the most common questions.
API ReferenceThe complete public API.
Supported .NET Versions
Starting with v5, Silverback targets the latest .NET LTS (Long-Term Support) version only. It can run on newer compatible .NET versions (including STS releases), but older frameworks are no longer targeted or supported. This policy reduces maintenance overhead and keeps Silverback aligned with the .NET platform lifecycle.
Community
- Issues – report bugs or suggest improvements.
- Discussions – ask questions and share ideas.
- Contributing – how to contribute.
Silverback is open source, licensed under the MIT License and maintained by Sergio Aquilini. Learn more about the project, its maintainer and the libraries it builds upon in About Silverback.