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

More explicit docs on SQS message acknowledgment? #36

Closed
noozo opened this issue Oct 22, 2019 · 4 comments
Closed

More explicit docs on SQS message acknowledgment? #36

noozo opened this issue Oct 22, 2019 · 4 comments

Comments

@noozo
Copy link

noozo commented Oct 22, 2019

Hey guys, great work on both Broadway and BSQS!

I was reading the documentation and it was not immediately obvious to me how the messages get acknowledged (or not) back to AWS in the handle_batch function.

Am i correct to assume that any messages that are returned as the return value get acknowledged and those who are not do not? If so, i think the phrasing on the docs could reflect this a bit better for newcomers. If not, do i have to somehow change the message to make sure it doesn't get acknowledged when i fail to process it?

Thanks in advance!
Pedro

@josevalim
Copy link
Member

handle_batch should always return all messages it receives, I will update the docs to make this clear. For changing the ack behaviour on failure, see #17.

@noozo
Copy link
Author

noozo commented Oct 22, 2019

Hey Jose, thanks for the quick answer. But you got me even more confused now :)

Say i am processing a batch of 10 messages but i don't like message number 9 for some reason and don't want to ack that one (i.e. want it to go to the error queue after the redrive policy count is reached). How do i proceed in that case? Still return the 10 messages in handle_batch but modify the one that i want failed in some way?

Thanks again!

@noozo
Copy link
Author

noozo commented Oct 22, 2019

Ok, my bad. I should mark it as failed: https://hexdocs.pm/broadway/Broadway.Message.html#failed/2

@noozo noozo closed this as completed Oct 22, 2019
@josevalim
Copy link
Member

Np! I have added a warning if you happen to return less messages too.

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