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

EngineProtocolBest For
RabbitMQAMQP 0-9-1Reliable message delivery, complex routing, task queues
NATSNATS protocolHigh-throughput pub/sub, low latency, lightweight messaging
## Features
  • 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:

  1. Erlang + RabbitMQ installation — installs the Erlang runtime and RabbitMQ server, or installs the NATS server binary
  2. Cluster joining — configures Erlang cookies for RabbitMQ clustering or NATS route configuration for cluster formation
  3. User/permission management — creates vhosts, users, and permission sets for RabbitMQ
  4. HA configuration — sets up mirrored queue policies for RabbitMQ, or JetStream for NATS persistence
  5. TLS setup — generates and configures TLS certificates for encrypted client connections
  6. Health monitoring — checks queue depths, message rates, node connectivity, and memory usage
  7. 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.