Skip to main content

What is Relayer?

Relayer is a .NET messaging library. It wraps the native client for your broker (Kafka through Dekaf, Azure Service Bus, Amazon SQS/SNS, RabbitMQ) and removes the ceremony around it:

  • retries, delayed redelivery and dead-lettering with full error history
  • a transactional outbox and inbox
  • OpenTelemetry tracing, metrics and trace propagation
  • source-generated serialization that works under Native AOT
  • declared, validated topology
  • a test harness

It is not a new broker abstraction. Relayer never changes how the underlying client sends, receives, orders or acknowledges messages. Native settlement, partitioning, sessions and dead-letter queues are used as they are, and the native message is always one call away.

Early development

The core pipeline is implemented and tested: configuration, startup validation, source-generated handlers and messages, the send and consume pipelines, failure handling and declared topology. Broker transports, the outbox stores and telemetry are still in progress, and no NuGet packages are published yet. See the roadmap.

Principles​

  1. Wrap, don't replace. Each transport uses the native client for its broker. Relayer never emulates a feature the broker already has.
  2. No lowest common denominator. Portable concerns such as retries, the outbox and tracing work the same everywhere. Transport-specific features are typed extensions, such as context.Kafka(), rather than a generic option.
  3. Explicit over magic. No assembly scanning and no runtime code generation. Every handler, route and piece of topology is declared in code, or generated by a source generator you can read.
  4. Correct by default. At-least-once delivery, poison messages dead-lettered instead of crashing or stalling a consumer, and settlement only after the work is durable.
  5. Native AOT and trimming from day one. No reflection on the hot path.
  6. Performance is a feature. At most 5% throughput overhead against the raw client, and zero allocations per message from Relayer's own pipeline.
  7. Observable by default. OpenTelemetry messaging conventions, built into the core.
  8. Few dependencies. The core depends only on Microsoft.Extensions.* abstractions and the BCL.

Where to go next​