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
NuGet version NuGet downloads License: MIT

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

Explore the Documentation

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

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.

Looking for the previous version? The v4 documentation is still available at silverback-messaging.net/v4. Found a mistake? Please open an issue.