Same consumer getting the rejected message again

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Same consumer getting the rejected message again

reddylast
Hi,

I've set-up multiple queues and multiple consumers are processing those queues. There is a case when a consumer receives a message , if that consumer is not authorized  to process that message then system sent it back to the queue (by using basic.reject method). I want to stop the same consumer getting the same rejected message  again and again. Is there any way that prevents a message from looping through the system forever ?

Thanks,
Reddy

Reply | Threaded
Open this post in threaded view
|

Re: Same consumer getting the rejected message again

Emile Joubert


Hi,

On 29/03/13 07:44, reddylast wrote:

> I've set-up multiple queues and multiple consumers are processing those
> queues. There is a case when a consumer receives a message , if that
> consumer is not authorized  to process that message then system sent it back
> to the queue (by using basic.reject method). I want to stop the same
> consumer getting the same rejected message  again and again. Is there any
> way that prevents a message from looping through the system forever ?

If you requeue a message then it will return to the queue in the same
position that it was, and that may lead to the same consumer getting the
message if it goes to the front of the queue.

You could re-publish the message instead of requeueing, which will force
it to the back of the queue and hope that a different consumer gets the
message when it reaches the front. You could also publish such messages
to a different location where you guarantee that authorisation will not
fail.

In general you should try to route messages to separate queues and bind
consumers in such a way that they will only receive messages which they
are able to process.



-Emile




_______________________________________________
rabbitmq-discuss mailing list
[hidden email]
https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss