Relayer.AzureServiceBus.HealthChecks 0.1.3

Prefix Reserved
There is a newer version of this package available.
See the version list below for details.
dotnet add package Relayer.AzureServiceBus.HealthChecks --version 0.1.3
                    
NuGet\Install-Package Relayer.AzureServiceBus.HealthChecks -Version 0.1.3
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Relayer.AzureServiceBus.HealthChecks" Version="0.1.3" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Relayer.AzureServiceBus.HealthChecks" Version="0.1.3" />
                    
Directory.Packages.props
<PackageReference Include="Relayer.AzureServiceBus.HealthChecks" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Relayer.AzureServiceBus.HealthChecks --version 0.1.3
                    
#r "nuget: Relayer.AzureServiceBus.HealthChecks, 0.1.3"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Relayer.AzureServiceBus.HealthChecks@0.1.3
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Relayer.AzureServiceBus.HealthChecks&version=0.1.3
                    
Install as a Cake Addin
#tool nuget:?package=Relayer.AzureServiceBus.HealthChecks&version=0.1.3
                    
Install as a Cake Tool

Relayer

Messaging for .NET without the boilerplate. Relayer wraps the native client for your broker and takes care of everything you would otherwise write around it: retries, dead-lettering, the outbox, tracing, serialization, topology and testing.

Status: early development. Pre-1.0 packages are on NuGet, and APIs may still change. The roadmap lists what works today.

The name

Relayer is two words in one:

  • Relay: it passes messages from one part of your system to another.
  • Layer: it is a thin layer over your broker's own client, which hides the complexity and repetitive code and leaves the broker's behavior alone.

Why use it

Sending a message is easy. Running messaging in production is not. Around every send and receive you need retries, a place for poison messages to go, a way to commit a message together with a database change, trace propagation, serialization and tests. Most teams rewrite this for every service, slightly differently each time.

Relayer gives you that code once, tested, with safe defaults:

You get What it means
Failure handling Retries, delayed redelivery and dead-lettering with error history. A bad message never crashes or stalls a consumer.
Outbox and inbox Save a database change and its outgoing message in one transaction. Duplicate deliveries are filtered out on the way in.
Observability OpenTelemetry traces and metrics, with trace context carried across the broker.
Serialization Source-generated System.Text.Json by default, with Protobuf, MessagePack and Avro as options.
Topology Declare queues and topics in code. Relayer validates them at startup, or provisions them where the broker allows.
Testing An in-memory transport and a test harness, so you can test message flows without a broker.

What it looks like

Declare a message with a stable name:

[Message("orders.placed", Version = 1)]
public sealed record OrderPlaced(string OrderId, string CustomerId);

Write a handler:

public sealed class OrderPlacedHandler(Billing billing) : IHandler<OrderPlaced>
{
    public async ValueTask HandleAsync(OrderPlaced message, MessageContext context, CancellationToken cancellationToken)
    {
        await billing.CreateInvoiceAsync(message, cancellationToken);
    }
}

Connect them to a broker:

builder.Services.AddRelayer(relayer =>
{
    relayer.AddMessageTypesFromThisAssembly();
    relayer.Kafka("events", kafka =>
    {
        kafka.Options.Configure(options => options.BootstrapServers.Add("localhost:9092"));

        kafka.Send<OrderPlaced>("orders", route => route.OrderingKey(order => order.CustomerId));

        kafka.Consume("orders", consumer =>
        {
            consumer.Options.Group = "billing";
            consumer.Concurrency(8);
            consumer.Handler<OrderPlacedHandler>();
        });
    });
});

Send from anywhere:

await sender.SendAsync(new OrderPlaced(orderId, customerId));

That is a complete setup. Failed messages are retried and then dead-lettered, offsets are committed only after the handler finishes, messages with the same key stay in order, and every hop is traced.

Need the message and a database change to commit together? Add the outbox and send inside your transaction:

await using var transaction = await db.Database.BeginTransactionAsync(cancellationToken);
db.Orders.Add(order);
await sender.SendViaOutboxAsync(new OrderPlaced(order.Id, order.CustomerId), cancellationToken);
await db.SaveChangesAsync(cancellationToken);
await transaction.CommitAsync(cancellationToken);

How it works

It wraps, it does not replace. Each transport is a thin adapter over the broker's native client. Sending, receiving, ordering and acknowledgment work exactly as that client does them. Relayer never emulates a feature the broker already has.

Nothing is hidden from you. Native configuration passes through unchanged, and the native message is always one call away. Broker-specific features are typed extensions such as context.Kafka(), not a lowest-common-denominator option.

No magic. There is no assembly scanning and no reflection on the message path. A source generator writes the registration and dispatch code at compile time, and you can read it. Analyzers catch mistakes as you type, and startup validation catches the rest before the first message moves.

Performance is a feature. The budget is at most 5% throughput overhead against the raw client and zero allocations per message from Relayer's own pipeline. Relayer is Native AOT and trimming safe.

Supported brokers

Broker Native client
Apache Kafka Dekaf
Azure Service Bus Azure.Messaging.ServiceBus
Amazon SQS and SNS AWSSDK.SQS, AWSSDK.SimpleNotificationService
RabbitMQ RabbitMQ.Client
NATS JetStream NATS.Client.JetStream
Google Cloud Pub/Sub Google.Cloud.PubSub.V1
In-memory Built in, for tests and local development

Outbox stores: PostgreSQL, SQL Server and MySQL. RabbitMQ Streams and Apache Pulsar are planned. See transports for the status of each.

Try it

Relayer targets .NET 10 and later. Add the core package and the transport for your broker:

dotnet add package Relayer
dotnet add package Relayer.Kafka

Or run a sample from the repository, which needs the .NET 11 SDK and the .NET 10 runtime. This one runs without a broker:

git clone https://github.com/thomhurst/Relayer.git
cd Relayer
dotnet run -c Release --project samples/ModularMonolith

More in samples/: Kafka with an EF Core outbox, an Azure Service Bus web API and an Aspire app host.

Documentation

Contributing

dotnet build -c Release
dotnet test -c Release --project tests/Relayer.Tests --treenode-filter "/*/*/ClassName/*"

See the contributing guides for testing, performance and documentation.

License

MIT

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed.  net11.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated
0.3.1 57 12/4/2026
0.3.0 100 11/24/2026
0.2.0 107 11/23/2026
0.1.4 119 11/19/2026
0.1.3 101 11/19/2026
0.1.2 101 11/15/2026
0.1.1 107 11/15/2026