Skip to content

Conversation

@netqyq
Copy link
Contributor

@netqyq netqyq commented Apr 10, 2017

chore: Typo. Ack operation should be an the end of loop.

How to reproduction the problem

go run worker.go
go run worker.go

then run :

go run new_task.go hello world.....

this message will be send to one of the worker, if normal, it wait 5 seconds in the worker, but we press Ctrl+C stop it before 5 seconds. the message will lost in current worker, it should be send to another worker immediately, But it won't be like this.

after change move ack to the end of loop, it works.

after all, we should send ack after the job was done.

fix: Ack should be an the end of loop.
@michaelklishin michaelklishin merged commit ad57c45 into rabbitmq:master Apr 10, 2017
@michaelklishin
Copy link
Contributor

Thanks. This tutorial does not focus on acknowledgements or error handling but it's not a bad idea to ack at the very end. Please update the website copy on the live branch.

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