Skip to content

About

Silverback is a message bus and broker integration library for .NET. It is designed to simplify event-driven architectures and asynchronous messaging, with first-class support for Apache Kafka and MQTT.

Topics

Resources

Contributing

Stars

283 stars

Watchers

13 watching

Forks

Latest commit

 

History

1,728 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Silverback

Simplicity at its core. Flexibility at its peak. Effortless messaging for .NET.

Silverback is a message bus and broker integration library to build event-driven architectures with first-class support for Apache Kafka and MQTT.

NuGet version NuGet downloads License: MIT

Documentation, guides, and samples are available at https://silverback-messaging.net.

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) => ...;
}

Follow the Quickstart for a complete, runnable walkthrough.

Why Silverback

  • Kafka-first, not Kafka-only – a consistent, fluent API for Kafka and MQTT that still surfaces partitions, keys, tombstones and transactions.
  • Reliable by design – transactional outbox, error policies (retry, skip, move) and storage-backed offsets and locks.
  • Built for throughput – partition-based parallelism, batch processing, streaming and chunking of large payloads.
  • Cross-cutting features – serialization, Schema Registry (JSON, Avro, Protobuf), headers, validation and end-to-end encryption.
  • Observable – structured logging, distributed tracing via System.Diagnostics and health checks.
  • Testable – in-memory Kafka and MQTT brokers and testing helpers for fast and reliable end-to-end tests.

Packages

Silverback is modular – reference only what you need.

Core:

Broker integration:

Optional features:

Storage (for outbox, client-side offsets, distributed locks):

Testing:

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.

Documentation

The v4 documentation is still available at silverback-messaging.net/v4.

Project Status

Continuous Build

Continuous Build Status Tests Status (release/5.0.0)

Sonar Build

Sonar Build Status

Quality Metrics

Quality Gate Status Maintainability Rating Reliability Rating Security Rating

Lines of Code Coverage Duplicated Lines (%)

Bugs Code Smells Vulnerabilities Technical Debt

Activity

GitHub bugs GitHub issues GitHub pull requests GitHub last commit

Repository Solutions and Tools

Solutions

Solution Contents
Silverback.sln Library source projects, unit and E2E tests, and code/documentation generators
Silverback.Samples.sln Runnable usage examples; see the samples guide
Silverback.Tests.Extended.sln Interactive testbench, real-broker integration and stress tests, general benchmarks and version comparisons, with references to the library sources

Testing and Development Tools

Tool Purpose
Interactive testbench Windows WPF application for producing messages and managing Docker consumers
Integration tests xUnit tests against real Kafka and MQTT brokers, including stress workloads and diagnostic controls
Benchmarks General performance benchmarks and current-versus-historical Silverback comparisons
UpdateOlderVersions.ps1 Scaffold another historical benchmark project
coverage.ps1 Build and test the main solution with coverage, then generate and open an HTML report
docker-compose.yaml Local Kafka, Schema Registry, MQTT and PostgreSQL infrastructure, with administration UIs
nuget/Update.ps1 Build local Silverback packages for package-based development and samples
.NET tool manifest Repository-local ReportGenerator installation used by the coverage script

Code and Documentation Generators

The four generator applications are included in the main solution and write generated content to standard output. Shared generator support lives in Silverback.Tools.Generators.Common.

Tool Purpose
KafkaConfigProxies Generate Kafka configuration wrappers and builders; also supports Schema Registry configuration
MqttConfigProxies Generate MQTT configuration wrappers and builders
Docs.Headers Generate message-header reference tables
Docs.LogEvents Generate log-event reference tables
docs/build.ps1 Build and serve the DocFX documentation locally; run from the docs directory
docs/publish.ps1 Publish the generated site through a separate gh-pages checkout; supports -NoPush

Build automation is defined in the main pipeline, the Sonar pipeline, and the samples/extended-tests pipeline.

Community

License

Silverback is open source, licensed under the MIT License and maintained by Sergio Aquilini. See LICENSE.

About

Silverback is a message bus and broker integration library for .NET. It is designed to simplify event-driven architectures and asynchronous messaging, with first-class support for Apache Kafka and MQTT.

Topics

Resources

Contributing

Stars

283 stars

Watchers

13 watching

Forks

Releases

Used by

Contributors

Languages