This is a read-only mirror of the HSC engineering wiki, restored from a 2017 archive. Some links are broken and some content is out of date. About this mirror.

Agent Message Bus

From ANTFARM Wiki

Jump to: navigation, search
This is an old revision of this page, as archived. The mirror serves the archived text for every revision id.
Agent Message Bus
Servicephero
Port7421
Patternpub/sub over TCP
Deliveryat-least-once
Ownerdlopes
Statuscurrent
Archive refQUANTARA-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.

[edit] See also

Revision 22 · dlopes, mkerrigan · history · alternates: json txt
Personal tools