[rabbitmq-discuss] can rabbitmq(amqp) do this for me?
michael.s.klishin at gmail.com
Mon Mar 3 10:00:41 GMT 2014
2014-03-03 13:52 GMT+04:00 Li Li <fancyerii at gmail.com>:
> I want to use something like a message queue to implement a
> distributed system. there are one producer and many consumers to
> balance the load. messages will be randomed dispatched to all the
> consumers. if one consumer receive a message, it will process this
> message. but sometimes this particular consumer will be unable to
> process this message, it can 'refuse' this message and other consumers
> can process this one?
There is a couple of ways to do it:
* Use a single queue per consumer (straightforward, not scalable with
large message volumes) and basic.reject. This will give you round-robin
distribution between consumers.
See tutorial 2:
http://www.rabbitmq.com/getstarted.html if this sounds appropriate for your
* Use a queue per consumer, (mostly) evenly distribute messages between
x-random or x-consistent-hash exchanges:
(the latter ships with recent RabbitMQ versions but need to be enabled
In this case to refuse processing a message, consumers will have to
to the exchange. This in turn requires more careful error handling logic in
The latter approach is much more scalable.
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the rabbitmq-discuss