ZeroMQ Routing
Goal
Build addressed asynchronous routing without losing message-envelope, readiness, or peer-lifecycle semantics.
Workflow
- Draw each hop and label which side binds and which connects.
- Separate routing envelope from application body.
- If a ROUTER is involved, define the routing identity lifecycle explicitly.
- Route work only to peers that have declared readiness/capacity.
- Keep broker logic minimal: routing, liveness, service lookup, and bounded state; business logic stays at endpoints.
- For symmetric peer networks, consider the Guide's Harmony shape: one bound inbox plus one connected outbound socket per peer.
- Require an initial HELLO/READY handshake before accepting stateful traffic.
- Define what happens to unknown, stale, disconnected, and duplicated peer identities.
- Verify with delayed connect, reconnect, endpoint reuse, peer churn, and unroutable-message tests.
Rules
- Do not treat ROUTER identity as user identity or authorization.
- Avoid sending to a peer before the protocol says it is routable/ready.
- Prefer explicit failure for unroutable sends when the runtime supports it.
- Keep route metadata outside opaque application payloads when intermediaries need to forward without understanding the body.
- A blocked peer must not stall unrelated peers.
- Guide-era ROUTER-to-ROUTER limitations are historical; verify current routing-ID/probe features before asserting what a modern runtime can do.