[rabbitmq-discuss] Messages as mutex tokens - rewrite or nack
Laing, Michael P.
Michael.Laing at nytimes.com
Thu May 30 13:34:13 BST 2013
Our clusters support apps that do work periodically, e.g. Every few seconds or minutes, typically analyzing/reporting the state of other apps.
We run an identical instance of each app connected to each node of the cluster. The apps each subscribe to a 'token' mirrored queue which is seeded with a single message.
One app gets the message, does its work, waits for the appropriate interval, and then republishes the token message to the queue. The next app gets the message - they proceed in a round robin fashion.
Today I am reviewing and refactoring this logic, and I wonder if it would be better to keep a single token message and just nack it instead of rewriting. Nacking is a little simpler.
However, I see in the documentation for BasicReject that the broker may not want to deliver the same message within the same channel context; does this hold for BasicNack as well?
In a cluster with one node, the above pattern using rewrite works fine. Would it still work using nack or would the app have to close the channel and resubscribe using a new one (probably too expensive/messy)?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss