v0.2.0 — mock server (HTTP + Kafka) + gated db execute
Highlights
agctl mock run — HTTP + Kafka mock server
A self-contained mock server for local testing of systems with HTTP/Kafka integrations (reverses the original "no built-in mock" design decision). Foreground command that streams NDJSON events to stdout.
- HTTP — embedded stdlib
ThreadingHTTPServerwith path-template routing (/orders/{id}), request capture into response templates, JSON/body matching, configurabledelay_ms, chunked transfer-encoding support, and a concurrency cap (overload → 429). - Kafka reactors — committed consumers on your real broker that match messages with jq, capture values, and produce templated reactions. Visible skip/error semantics (fail-loudly: §11).
- Streams
started,http.hit/http.unmatched,kafka.reacted/kafka.skipped/kafka.error, andsummary; clean exit codes (0 clean / 1 runtime error / 2 config or startup). - Flags:
--fail-fast,--duration,--only http|kafka,--http-listen. Configured via the newmocks:section inagctl.yaml.
Limitation (MVP): stateless, within-transport reactions only (HTTP→HTTP, Kafka→Kafka). No cross-transport sagas or cross-call state — see DESIGN §16.2.
agctl db execute (gated write)
Gated write/execute command for the DB surface, behind an explicit gate.
Reliability fixes (post-merge review fan-out, PR #8)
- Kafka
consume_loopretry now re-handles the same message in-memory instead of seek+re-poll. The old path could return a different-partition message after a seek, silently spinning on poison messages with no error emitted. - Engine exit code is decided post-join, so a runtime error landing during shutdown yields exit 1 (not a false-green 0).
Install
pip install agctl
pip install 'agctl[http,kafka,db]' # protocol extras