fix: dead-letter parse and handler failures; add DLQ binding#10
Merged
Conversation
…ing (#9) Parse failures in consumer.py were ACK'd (silent data loss). Handler failures were already nacked but the DLQ binding on knowledge.dlx was missing, so messages vanished. This change: - Switches parse failure path from basic_ack to basic_nack(requeue=False) so poison payloads route to knowledge.ingest.dlq via the DLX - Adds the missing Binding bean in IngestQueueConfig (knowledge.dlx → knowledge.ingest.dlq) and changes the DLX to FanoutExchange - Adds a Testcontainers integration test asserting malformed payloads land on the DLQ rather than disappearing - Updates unit tests to assert nack (not ack) on parse failures - Updates stale skeleton docs in README.md and __main__.py docstring MCP API gaps (link_note / project-vocabulary tools) are out of scope for this fix and tracked separately on the issue.
…ng broker Per codex review: switching knowledge.dlx from TopicExchange to FanoutExchange would cause PRECONDITION_FAILED on any broker that already has it declared. Retain TopicExchange and bind the DLQ with routing key knowledge.ingest.dlq (which the main queue already stamps as x-dead-letter-routing-key). Update the integration test topology to match.
This was referenced Jul 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #9
Changes
consumer.py— Parse failures (ValidationError,json.JSONDecodeError,UnicodeDecodeError) were previouslybasic_ack'd, causing silent data loss. They are nowbasic_nack(requeue=False)so the broker routes the poison payload toknowledge.ingest.dlqvia the DLX. Handler failures were already nacked but shared the same missing-binding problem.IngestQueueConfig.kt— The DLQ queue existed but there was no binding fromknowledge.dlxto it. Added the missingBindingbean. Changed the DLX declaration fromTopicExchangetoFanoutExchangeso any nacked delivery from the ingest queue lands on the DLQ regardless of routing key.Integration test — New
test_malformed_payload_routes_to_dlqtest spins up a real RabbitMQ container via Testcontainers, declares the full DLX topology, publishes a malformed payload, and asserts the body appears on the DLQ (not silently dropped).Unit tests — Two tests that asserted
basic_ackon parse failures are corrected to assertbasic_nack(requeue=False).Docs —
ingest-worker/README.mdandknowledge_worker/__main__.pydocstring updated to reflect the wiredVaultHandlerbehaviour and the error-handling contract.Out of scope
MCP API gaps (
link_note/link_notes, project-vocabulary tools) noted in the issue are a feature addition beyond this bug fix.