# Zeromq Reliability

> zeromq, reliability, retries, heartbeats, idempotency, recovery

- Skill: `lost-rob0t/zeromq-reliability` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add lost-rob0t/zeromq-reliability`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lost-rob0t/zeromq-reliability/raw
- Safety review: pending
- Works with: Claude Code, Claude.ai, OpenAI Codex
- Category: Coding & Dev Tools
- License: CC-BY-SA-3.0
- Author: lost-rob0t (https://skillmd.com/u/lost-rob0t)
- Updated: 2026-11-18
- Page: https://skillmd.com/skills/lost-rob0t/zeromq-reliability

---


# ZeroMQ Reliability

## Goal

Choose the least-complex recovery mechanism that handles the failures the
application actually needs to survive.

## Workflow

1. Enumerate failures separately: process crash, restart, busy loop, overload,
   link loss, partition, duplicate request, stale reply, broker loss, and
   storage loss.
2. Classify each operation as idempotent or non-idempotent.
3. Give retried non-idempotent work a stable request ID and a dedupe/reply
   policy before enabling automatic retries.
4. Bound every wait with a deadline or cancellation path.
5. Start with simple timeout + retry/failover; add heartbeats only when they
   detect a failure faster or more accurately than ordinary traffic.
6. Count any valid peer traffic as liveness when the protocol permits it.
7. Use reconnect backoff and jitter; do not spin on a dead endpoint.
8. Recreate strict-state sockets after protocol state becomes unusable.
9. Persist requests/results only when disconnected or durable execution is a
   requirement.
10. Test crash points before receive, during work, after side effect, before
    reply, and during reconnect.

## Rules

- Reconnect is transport behavior, not application-level exactly-once delivery.
- Never retry a side effect blindly.
- Sequence or generation-fence stale replies and state updates.
- Prefer a small pool/failover set over elaborate HA unless requirements demand
  consensus-level behavior.
- Treat Binary Star and other guide-era HA examples as teaching patterns, not
  substitutes for modern consensus when split-brain safety is required.

