Message Queue
Managed message queues backed by RabbitMQ (AMQP) or NATS (lightweight) with HA mirrored queues, clustering, and TLS.
Message Queue
The Message Queue service provides managed messaging backed by RabbitMQ (AMQP protocol) or NATS (lightweight pub/sub). The Message Queue Agent handles installation, clustering, user management, and high availability.
Engines
| Engine | Protocol | Best For |
|---|---|---|
| RabbitMQ | AMQP 0-9-1 | Reliable message delivery, complex routing, task queues |
| NATS | NATS protocol | High-throughput pub/sub, low latency, lightweight messaging |
- HA mirrored queues — RabbitMQ queues can be mirrored across nodes for high availability
- Management UI — RabbitMQ includes a web-based management interface for monitoring
- Clustering — both engines support multi-node clusters for scalability
- TLS — encrypted connections between clients and the message broker
- User/permission management — fine-grained access control per vhost and queue
Create a Message Queue
RabbitMQ Cluster
agentmetal queue create \
--name events \
--engine rabbitmq \
--nodes 3 \
--ha
NATS Cluster
agentmetal queue create \
--name notifications \
--engine nats \
--nodes 3
Manage Users (RabbitMQ)
agentmetal queue user create events \
--username app \
--password-from-secret app-mq-password \
--vhost / \
--permissions "configure=.:write=.:read=.*"
Get Connection Info
agentmetal queue get events --connection-string
Output for RabbitMQ:
amqp://app:**@events.internal:5672/
Enable HA Policies (RabbitMQ)
Configure queue mirroring:
agentmetal queue policy set events \
--name ha-all \
--pattern ".*" \
--definition '{"ha-mode": "all", "ha-sync-mode": "automatic"}'
What the Agent Manages
The Message Queue Agent performs these operations:
- Erlang + RabbitMQ installation — installs the Erlang runtime and RabbitMQ server, or installs the NATS server binary
- Cluster joining — configures Erlang cookies for RabbitMQ clustering or NATS route configuration for cluster formation
- User/permission management — creates vhosts, users, and permission sets for RabbitMQ
- HA configuration — sets up mirrored queue policies for RabbitMQ, or JetStream for NATS persistence
- TLS setup — generates and configures TLS certificates for encrypted client connections
- Health monitoring — checks queue depths, message rates, node connectivity, and memory usage
- Self-healing — restarts crashed nodes, re-joins partitioned cluster members, and rebalances queues
Management UI
For RabbitMQ, access the management UI:
agentmetal queue get events --management-url
The management interface provides real-time visibility into queues, exchanges, bindings, connections, and channels.