Skip to content

Examples

Complete, copy-pasteable examples for common RabbitMQ patterns.

Pub/Sub (Fanout)

One publisher, multiple independent subscribers. Every subscriber receives every message. Uses predefined.fanoutExchange.

Work Queue

One queue, multiple competing consumers. Each message is processed by exactly one worker. Demonstrates fair dispatch with prefetch: 1 and ConsumptionFailureStrategy.Requeue.

Topic Routing

Messages routed to subscribers based on routing key patterns. Demonstrates orders.eu.* vs orders.# with a topic exchange.

Graceful Shutdown

How to stop producers, consumers, channels, and connections cleanly on SIGTERM or SIGINT using RabbitCloser.

Released under the MIT License.