Skip to content

AMQP (RabbitMQ)

AMQP via RabbitMQ is the production default for distributed deployments. Mature, widely deployed, with excellent tooling.


StrengthBenefit
Mature15+ years of production use
Durable queuesMessages survive broker restarts
Flexible routingTopic exchanges, headers, fanout
Management UIBuilt-in web console
Dead letter queuesAutomatic failure handling

[bus]
backend = "amqp"
[bus.amqp]
url = "amqp://guest:guest@localhost:5672"
exchange = "angzarr.events"
prefetch_count = 10
Terminal window
export AMQP_URL="amqp://guest:guest@localhost:5672"
export BUS_BACKEND="amqp"

Angzarr creates a topic exchange for event routing:

flowchart LR
    EX["Exchange: angzarr.events<br/>(topic)"]
    EX -->|"player.#"| PP[queue: player-projector]
    EX -->|"player.#"| OP[queue: output-projector]
    EX -->|"hand.#"| HS[queue: hand-saga]

Events are published with routing keys: {domain}.{event_type}

player.PlayerRegistered
player.FundsDeposited
hand.CardsDealt
hand.HandComplete

Each handler gets a dedicated queue with configurable durability:

# Handler queue settings
queues:
player-projector:
durable: true
auto_delete: false
exclusive: false
arguments:
x-dead-letter-exchange: angzarr.dlx

Failed messages route to a dead letter exchange:

flowchart LR
    DLX["angzarr.dlx<br/>(fanout)"] --> DLQ["angzarr.dlq<br/>(queue)"]

Monitor the DLQ for processing failures:

Terminal window
# Check DLQ depth
rabbitmqctl list_queues name messages | grep dlq

values.yaml
bus:
backend: amqp
amqp:
enabled: true
host: rabbitmq.messaging.svc.cluster.local
port: 5672
credentials:
secretName: rabbitmq-credentials
usernameKey: username
passwordKey: password

Terminal window
# Run AMQP tests (requires testcontainers)
cargo test --test bus_amqp --features amqp
# Requires podman socket
systemctl --user start podman.socket

RabbitMQ includes a web management interface:

http://localhost:15672
Default credentials: guest/guest

Monitor:

  • Queue depths
  • Message rates
  • Consumer connections
  • Exchange bindings

  • Production default — Most deployments
  • Existing RabbitMQ — Already in infrastructure
  • Complex routing — Headers, topics, fanout
  • Operational maturity — Team familiarity