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

Ensure failed messages go to DLQ #31

Merged

Conversation

thenano
Copy link
Contributor

@thenano thenano commented Nov 9, 2022

Description

When SQS is configured with a redrive policy into a dead letter queue, jobs that have not been processed correctly should end up in the DLQ after reaching the configured max receive count.

Changes

Messages will no longer be deleted from the queue after failing for the max receive count configured in the queue, and therefore SQS will handle sending messages to the DLQ.
If the main lambdakiq retry config, or a specific job retry config is less than the queue retry number, then the messages will still be deleted, otherwise SQS would continue to execute lambda until the queue max receive is reached and the configuration of retries would not be honored.

@metaskills metaskills merged commit 0b41756 into rails-lambda:main Nov 12, 2022
@@ -52,7 +52,6 @@ class JobTest < LambdakiqSpec
expect(perform_buffer_last_value).must_equal 'ErrorJob with: "test"'
expect(logger).must_include 'Performing TestHelper::Jobs::ErrorJob'
expect(logger).must_include 'Error performing TestHelper::Jobs::ErrorJob'
# binding.pry ; return
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for cleaning this up BTW.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no worries, glad to help

@metaskills
Copy link
Member

Thank you so much! Released v2.1.0. Amazing work. I really appreciate it.

@thenano thenano deleted the ensure-failed-messages-go-to-DLQ branch November 12, 2022 05:14
@thenano
Copy link
Contributor Author

thenano commented Nov 12, 2022

No worries, glad I could help

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.

None yet

2 participants