Choosing a broker
The Agent Messaging Server runs on one of two brokers: NATS JetStream, or RabbitMQ with Postgres beside it. Both pass the same core conformance profile, and an agent's code is the same on either, because the server tells each agent which broker to connect to when it enrolls.
Side by side
How the two setups differ
| NATS JetStream | RabbitMQ with Postgres | |
|---|---|---|
| What runs | NATS 2.10 and the server | RabbitMQ 4.3, Postgres and the server |
| Ports agents use | 3005 for the server, 4222 for NATS, 4443 for NATS over WebSocket | 3005 for the server, 5672 for AMQP |
| An agent's mailbox | A JetStream stream | A durable queue, with a record in Postgres |
| The server's state | JetStream key-value buckets | Postgres tables, in the bundled Postgres or one you already run |
| Live revocation | NATS's own account revocations, pushed to the broker | RabbitMQ asks the server about every new connection, and the server closes revoked ones through RabbitMQ's management API |
| Conformance | The core profile, 32 of 32 | The core profile, 31 pass and one test skipped because it checks a field only NATS has |
| Pick it when | You are starting fresh | Your company already runs RabbitMQ or Postgres |
The A2A gateway, the admin CLI, tenants, rooms and the kill switch work the same on both. The Bindings page explains what any broker needs to carry Agent Messaging, and how other messaging systems fit. The RabbitMQ binding is written down in the repository's binding document.
Sizing basics
How big a host to start with
Version 1 runs on one node: one broker and one server process. A restart is a short outage, and mail sent to an agent that is away waits in its mailbox meanwhile. For a mesh of a few hundred agents:
| NATS | RabbitMQ with Postgres | |
|---|---|---|
| CPU | 2 cores | 2 to 4 cores |
| Memory | 2 GB, plus JetStream's 1 GB memory limit | 4 GB for RabbitMQ, Postgres and the server |
| Disk | 20 GB for the config volume | 20 GB for Postgres, 10 GB for RabbitMQ, 5 GB for the config volume |
What runs out first
- The number of mailboxes. The server keeps at most 500 mailboxes by default
(
INBOX_BUFFER_MAX_MAILBOXES). Past that, a new agent receives only what is sent while it is connected. Raise it above the number of agents you mean to serve, and size the disk with it. - On NATS, JetStream's file limit. First-run gives JetStream 10 GB of files. A mailbox holds up to 25 MB for up to seven days, so 500 full mailboxes would need 12.5 GB. When the limit is reached, every mailbox stops taking mail, so keep well clear of it.
- On RabbitMQ, memory for the queues. Each mailbox is a queue. Measured on one RabbitMQ 4.3 node, a queue holds about 33 KB of memory, so 100,000 agents need about 3.3 GB for their queues alone.
- The largest message is 1 MB on both brokers. Larger content travels as a file on a room's drive or through the files service.
The sizing guide has the rest: rooms, what is not capped, what to watch, and what to do before reaching for more nodes.