[rabbitmq-discuss] Single vs Multiple Queues
Alexis Richardson
alexis.richardson at gmail.com
Wed Jan 6 07:07:24 GMT 2010
Vishnu
If you hang multiple consumers off a single queue, then that queue's
state is shared and those consumers share the messages out between
them "round robin" style. This is good for the 'master worker'
pattern for example. Now, you can also have multiple queues doing a
master/worker type application. For example you could have four
queues, one for 'large' tasks (messages), one for 'medium', one for
'small', and one more queue that gets a copy of all messages for
logging and management. Each of those queues could be private to one
consumer, or it could be shared among a 'pool' of consumers (eg worker
threads).
In the above 'large'. 'medium', 'small' tasks example, you can load
balance work by size by allocating different numbers of consumers to
each queue. So, if you want to filter your flows in the broker, use
many queues. Using just one queue forces you to manage any filtering
in your thread pool.
alexis
On Wed, Jan 6, 2010 at 3:53 AM, vishnu <pathsny at gmail.com> wrote:
> Hi
> We're looking at building a back end which picks up 3 or 4 different
> messages. Now we have the option of using a single queue and sending
> different messages through it, or multiple queues each of which is dedicated
> for a single kind of message.
> We're wondering what's more common. We're thinking of using Scala with lift
> amqp or the Java api to connect to RabbitMq. On one hand using multiple
> queues makes it seem like we're going to have to prioritise the number of
> threads or processes per queue which seems like we're trying to optimise
> that.
>
>
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> http://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>
>
More information about the rabbitmq-discuss
mailing list