feat: route terminal jobs to a durable DLQ

Declare the classic dead-letter topology, reject terminal worker outcomes
without requeue, and add coverage for malformed messages and retry jitter.
This commit is contained in:
Самохвалов Андрей Ремович
2026-11-27 14:15:44 +03:00
parent 2c46d02205
commit e7f68aa69c
14 changed files with 550 additions and 85 deletions
+24 -16
View File
@@ -1,22 +1,30 @@
Lab5 broker-only bootstrap check, 2026-10-02, local Colima Docker.
Lab5 main Compose classic-queue check, 2026-11-27, local Colima Docker.
Commands (from repository root; local ignored secrets generated first):
python3 scripts/init_local_broker.py
docker compose -f compose.broker.yaml config --quiet
docker compose -f compose.broker.yaml up -d
docker compose -f compose.broker.yaml ps -a
docker compose -f compose.broker.yaml restart broker
docker compose -f compose.broker.yaml exec -T broker rabbitmqctl list_queues name durable type
Commands (from repository root):
./scripts/01-demo-setup.sh
docker compose --env-file .env exec -T broker rabbitmqctl list_queues name durable type arguments messages_ready messages_unacknowledged
docker compose --env-file .env restart broker
docker compose --env-file .env up -d --wait broker
docker compose --env-file .env exec -T broker rabbitmqctl list_queues name durable type arguments messages_ready messages_unacknowledged
docker compose --env-file .env exec -T broker rabbitmqctl list_exchanges name type durable
docker compose --env-file .env exec -T broker rabbitmqctl list_bindings source_name destination_name destination_kind routing_key
Observed after first bootstrap:
Observed after bootstrap:
broker: Up (healthy)
broker-init: Exited (0)
Durable quorum queue attachments.process is ready
attachments.process true classic DLX=attachments.dlx; key=attachments.dead 0 0
attachments.dlq true classic - 0 0
attachments.dlx direct, durable
attachments.dlx -> attachments.dlq, routing key attachments.dead
Observed after broker restart, before another bootstrap:
name durable type
attachments.process true quorum
Observed after broker restart:
broker: Up (healthy)
attachments.process true classic DLX=attachments.dlx; key=attachments.dead 0 0
attachments.dlq true classic - 0 0
attachments.dlx direct, durable
attachments.dlx -> attachments.dlq, routing key attachments.dead
No broker ports were published. This verifies queue metadata survives a
container restart with broker_data; it does not verify message persistence,
publisher confirms, worker acknowledgements, or full lab5 readiness.
The durable classic queues, DLX, and binding survive a broker restart with
broker_data. This check does not verify persistence of queued messages,
publisher confirms, or worker acknowledgements. Demo tests cover those paths.
No broker ports are published to the host.