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

How should messages go to the dead letter queue? #30

Closed
thenano opened this issue Nov 4, 2022 · 7 comments
Closed

How should messages go to the dead letter queue? #30

thenano opened this issue Nov 4, 2022 · 7 comments

Comments

@thenano
Copy link
Contributor

thenano commented Nov 4, 2022

Hi all,

Firstly I'd like to thank you all for this amazing piece of software. The work done with lamby/lambdakiq/lambdapunch is awesome and opens up the world of lambda to rails apps. Thanks so much!

I'm a bit confused as to how the dead letter queue redrive functionality from SQS is supposed to work with lambdakiq. I was a bit surprised to find that when my job fails with some exception, my messages actually don't end up in the dead letter queue at all, after the max retries (set either in the redrive policy or in the configs). After looking at the code I can see that once the max retry number is reached, lambdakiq will log retry_stopped and delete the message from the queue. I later noticed that only when something breaks outside of the lamby/lambdakiq handler will that exception actually cause a failed lambda execution and therefore end with the message in the dead letter queue.
I'm wondering if this is how it was all intended to be, or if I'm missing something?

Thanks very much!

@metaskills
Copy link
Member

... my messages actually don't end up in the dead letter queue at all, after the max retries ... I can see that once the max retry number is reached, lambdakiq will log retry_stopped and delete the message from the queue ...

I'm pretty sure this is expected behavior. I modeled Lambdakiq after Sidekia & Redis. But after reading the docs again, I do see where we promote the DLQ usage. Damn... maybe you are right and that we should not call delete_message here https://github.com/customink/lambdakiq/blob/main/lib/lambdakiq/job.rb#L75. Would you like to make a PR with that change and see what happens?

@metaskills
Copy link
Member

Also, thank you for the kind words.

@thenano
Copy link
Contributor Author

thenano commented Nov 8, 2022

Hi @metaskills thanks for the reply. Sounds good I'll have a shot on a PR and sync back.

@thenano
Copy link
Contributor Author

thenano commented Nov 9, 2022

@metaskills I've created the pull request: #31
The pull request would also close #26
let me know what you think.

Thanks!

@metaskills
Copy link
Member

Cool, I'll take a look shortly. First sight, it looks amazing and we can release this soon.

@metaskills
Copy link
Member

Thank you so much! Released v2.1.0.

@thenano
Copy link
Contributor Author

thenano commented Nov 12, 2022

Amazing, thank you!

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

No branches or pull requests

2 participants