On 12 November 2014 at 17:33:58, Ive (
ive.c...@gmail.com) wrote:
> Yes, I do mean 'consumed'. I've already implemented an RPC-type
> mechanism to get processed responses back to the client, but
> I want to notify ONLY the publisher of the message if that message
> is not consumed with a certain time. A DLX looked like the right
> mechanism to do this, but getting the deadlettered message back
> to only the client that published it seems to be a little tricky.
>
> Basically I want to handle the case where consumers either haven't
> actually started up yet, or if they are all too busy to pop messages
> off the queue; so that I can notify the client within some reasonable
> timeout.
Right, so combining a TTL on messages and a DLX is the way to go. There previously
was a feature in RabbitMQ that handled this specific case but also carried a massive
performance penalty for clusters that didn't use it (immediate publishing).
If your publisher declares a new uniquely named queue to collect responses, can you
set its x-dead-letter-routing-key argument in such a way that it only receives
dead lettering notifications for that specific message?
Then your publisher would get 2 types of responses in a single queue, which is
quite manageable. Use the "type" property on messages to make it easy to tell
timeouts from results and propagate that notification to a Web client.
That doesn't sound very complicated. Perhaps I'm missing some limitation of
how x-dead-letter-routing-key can be set up in your specific case?