Enable Dead-Letter Queue (DLQ) in development configuration and enhance NATS consumer error handling. Update config.dev.toml to enable DLQ routing for failed messages. Modify NATS consumer to append DLQ subject to stream subjects if enabled. Improve error logging in message processing to include message IDs and DLQ routing status, ensuring better observability and error management.

This commit is contained in:
windyboy
2025-11-19 17:09:52 +08:00
parent 8914156a58
commit 5ad86d6296
4 changed files with 98 additions and 11 deletions
+1 -1
View File
@@ -123,6 +123,6 @@ health_timeout = "2s"
[dlq]
# Dead-Letter Queue configuration (only applies when mode = "jetstream")
# enabled: Enable DLQ routing for poison messages (messages that fail after max_deliver attempts)
enabled = false # Set to true when switching to JetStream mode
enabled = true # Set to true when switching to JetStream mode
# subject: NATS subject where failed messages will be published for manual inspection
subject = "caatsm.dlq"