Rabbit Relay

What is Rabbit Relay

A type-safe RabbitMQ messaging framework for Node.js built on amqplib

Rabbit Relay is a type-safe RabbitMQ framework for Node.js built on amqplib.

It keeps exchanges, queues, routing keys, acknowledgements, retries, dead-letter queues, and publisher confirms explicit while adding the production patterns most teams build themselves.


Why Rabbit Relay?

Raw amqplib gives you full control, but in real services it often leads to:

  • publishing without broker confirms
  • retry logic implemented differently everywhere
  • dead-letter queues created manually
  • message contracts only failing at runtime
  • reconnect logic restoring only part of the topology

Rabbit Relay gives these patterns a clear, typed, reusable shape.


What you get

FeatureWhat it does
Type-safe eventsDefine message shapes once, checked by TypeScript everywhere
Publisher confirmsWait for RabbitMQ to accept critical messages
Retry + DLQBounded retries, delayed backoff, poison-pill handling
RPCRequest/reply with correlation IDs and timeouts
ReconnectAuto-restore channels, topology, and consumers
ObservabilityLifecycle hooks, tracing, and metrics integration

Rabbit Relay vs amqplib

NeedamqplibRabbit Relay
Message contractsManual typesTyped event factories
Reliable publishingConfirm channelsBuilt-in confirms
Consumer loadManual prefetchPrefetch + concurrency
Failed messagesCustom queuesRetry/DLQ helpers
RPCManual correlationBuilt-in RPC
ReconnectCustom recoveryAuto topology restore
ObservabilityManual instrumentationLifecycle hooks

What it is not

  • Not a replacement for RabbitMQ knowledge
  • Not hiding exchanges, queues, or routing keys
  • Not promising exactly-once delivery by magic

Rabbit Relay keeps RabbitMQ visible, but gives it safer defaults and clearer APIs.


Next steps

On this page