Skip to content

docs(consumer): explain rejection of invalid queue metadata - #1063

Open
sbalabanov wants to merge 4 commits into
mainfrom
wt/sqc010-envelope-retention
Open

sbalabanov wants to merge 4 commits into
mainfrom
wt/sqc010-envelope-retention

Conversation

@sbalabanov

@sbalabanov sbalabanov commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

TL;DR: Explain why bad queue information is logged and rejected, not retried.

Summary

This is a comment-only clarification of the existing policy: invalid queue information is logged and rejected, not retried. The same bad input will not repair itself, so any follow-up is an operator decision. With no later dead-letter queue, rejection may mark the delivery finished and discard it.

Repro

  1. Send a message whose queue fields disagree, such as Tenant=tenant-a and queue_name=tenant-b.
  2. Validation logs the error and rejects the message before the handler runs.
  3. With no later dead-letter queue, rejection may mark it finished without another attempt. This PR documents that existing outcome; it does not change or retry the message.

Test Plan

Checked with the existing tests:

  • Invalid queue information is rejected before the handler runs.
  • SQL rejection without a downstream dead-letter queue is still acknowledged; normal dead-letter handling is unchanged.
  • Original validation tests and error logging are unchanged; the net code diff is only the explanatory comment.

Revert Plan

Remove the comment; existing message handling stays the same.

Issues

Summary:
Keep invalid envelope identities durable for subscriptions with unlimited retries and no further dead-letter queue. The pre-controller guard uses the registry's actual subscription policy to Nack these deliveries instead of Reject, while finite primary subscriptions keep their existing behavior.

Test Plan:
TestConsumer_ProcessDelivery_InvalidTenantMetadata covers final retention, finite primary rejection, and settlement failures. The consumer, SQL queue, and existing consumer integration Bazel targets verify the extracted change independently.

Revert Plan:
Revert the dependent gateway recovery change before this policy; leave retained final-queue rows intact.
Summary:
Restore the existing invalid-envelope rejection and original logging/tests, and document why unchanged invalid metadata is a permanent input error. With no downstream dead-letter queue, rejection may acknowledge and drop the delivery without retry; operators investigate the logged failure.

Test Plan:
Existing consumer validation tests, SQL Reject cases including no-DLQ acknowledgment, and consumer integration tests pass. Relative to current main, the complete change is only the explanatory comment; no tests or message-handling behavior change.

Revert Plan:
Revert the explanatory comment if it is no longer useful; preserve the existing rejection policy.
@sbalabanov sbalabanov changed the title fix(consumer): retain invalid final-queue envelopes docs(consumer): explain rejection of invalid queue metadata Nov 10, 2026
Summary:
Keep the same permanent-input rejection explanation at the pre-dispatch loop boundary. This leaves the original guard body untouched and allows the independent gateway change to land in either order without a historical-hunk conflict.

Test Plan:
Existing consumer, SQL delivery, and consumer integration targets pass. The net diff versus main remains only the three-line policy comment.

Revert Plan:
Remove the explanatory comment without changing logged rejection behavior.
Keep the platform clarification current with main without rewriting published commits. Its net diff remains only the rejection-policy comment.
@sbalabanov
sbalabanov marked this pull request as ready for review November 10, 2026 21:43
@sbalabanov
sbalabanov requested review from a team and behinddwalls as code owners November 10, 2026 21:43

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants