Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add a NATS "dead letter queue" stream for failing messages #5035

Merged
merged 1 commit into from
Nov 27, 2024

Commits on Nov 27, 2024

  1. feat: add a NATS "dead letter queue" stream for failing messages

    This change introduces a new NATS Jetstream stream called
    `DEAD_LETTER_QUEUES` which will contain metadata of messages that
    reached their consumer's `max_deliver` limit. Currently, only the
    `forklift-server` consumer for the `AUDIT_LOGS` stream is configured,
    but more streams and consumers could be configured to use this in the
    future.
    
    The forklift/audit logs NATS consumer is configured to attempt `4`
    deliveries of each message with a linear backoff (i.e. when a message is
    `nack`d) of 5 seconds, then 10, then 15 for a total of 30 seconds before
    the message metadata is added to the "dead letter queue" stream. Note
    that a "failed" message is *not* deleted from its source stream, but
    rather skipped over by that consumer. This allows us to inspect each
    failed message in place in the stream and decide how to triage any
    remediations.
    
    Co-authored-by: Nick Gerace <[email protected]>
    Signed-off-by: Fletcher Nichol <[email protected]>
    fnichol and nickgerace committed Nov 27, 2024
    Configuration menu
    Copy the full SHA
    a2cc8f8 View commit details
    Browse the repository at this point in the history