# Zeromq Operations

> zeromq, debugging, backpressure, threading, monitoring, shutdown

- Skill: `lost-rob0t/zeromq-operations` (Agent Skill, multi-file: 2 files)
- Install (CLI): `npx get-skill add lost-rob0t/zeromq-operations`
- Raw SKILL.md: https://api.skillmd.com/api/skills/lost-rob0t/zeromq-operations/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-operations

---


# ZeroMQ Operations

## Goal

Debug and operate ZeroMQ systems by observing message flow, queue pressure,
peer state, and lifecycle transitions instead of guessing from connection state.

## Workflow

1. Reproduce with the smallest topology and log protocol-level send/receive
   events with monotonic timestamps, peer IDs, generations, and message IDs.
2. Check startup ordering/handshake before blaming message loss.
3. Check subscription filters and routing identities.
4. Check HWM, send/receive timeouts, EAGAIN/drop behavior, and application
   processing rate; never treat configured HWM as an exact network queue size.
5. Confirm one application thread owns each classic ZeroMQ socket.
6. Make shutdown explicit: stop producers, drain/cancel intentionally, close
   sockets with chosen linger semantics, then terminate context.
7. Use socket monitoring for transport lifecycle and application traces for
   protocol semantics.
8. Randomize churn tests: connect, disconnect, restart, endpoint reuse, delay,
   malformed messages, slow peers, and process death.
9. Run many isolated peer actors in one test process when practical.
10. Turn every rare assertion/race into a deterministic regression test.

## Rules

- Assertions express invariants in tests/internal code; they are not user-facing
  error handling.
- A single blocked peer must not block the whole routing loop.
- Bound queues, retries, timers, message sizes, and per-peer state.
- Prefer message passing between threads over shared mutable socket state.
- Verify whether a chosen modern socket type is thread-safe and stable/draft in
  the deployed runtime before relying on it.

