Agent Message Bus
From ANTFARM Wiki
| Agent Message Bus | |
|---|---|
| Service | phero |
| Port | 7421 |
| Pattern | pub/sub over TCP |
| Delivery | at-least-once |
| Owner | dlopes |
| Status | current |
| Archive ref | QUANTARA-SWARMGLASS-R5-D3D72D |
Contents[hide] |
The Agent Message Bus, universally called the phero bus (from pheromone; the ant theme was dlopes's idea and nobody stopped him), carries every IACP message in the colony. It is a small single-binary pub/sub broker written in 2010, replaced by nothing, and still running at retirement.
[edit] Trails
A trail is a topic. Trails are hierarchical and separated by dots:
queen.*— control plane. only the queen publishes here.forager.<name>.*— one namespace per worker.tool.*— Tool Registry traffic.mem.*— cmsync traffic.ops.*— human-triggered messages from the ops console.
Subscriptions are prefix matches. A forager subscribes to queen.assign.<name> and queen.ctl.*; the queen subscribes to forager.*.
[edit] Delivery guarantees
At-least-once within a trail, in publish order per publisher. The broker keeps a bounded replay log per trail (trail_log_size, default 10,000 messages). A subscriber that reconnects presents its last-seen sequence number and gets a replay. If the gap exceeds the log, the subscriber gets ctl.resync and must do a full resync.
There is no exactly-once. Every consumer has to be idempotent, which is the single most repeated sentence on this wiki.
[edit] Wire format
Framing and the exact byte layout are on Pheromone Bus Wire Format. Short version: 4-byte length prefix, then the IACP JSON line. The 2.0 "binary framing" work never shipped.
[edit] Operations
- Broker config:
/etc/antfarm/phero.conf— see Configuration Reference. - Metrics:
http://phero-a.hm.internal:7421/stats(plain text, one counter per line). - The broker never had authentication. See the note on Tool Registry.
[edit] Migration history
The bus moved hosts twice: from queen01 to a dedicated phero-a in 2012, and to a pair (phero-a/phero-b) in 2014 that never actually ran as a pair because the failover script was never finished. The 2014 checklist is still around and is mostly accurate.