[rabbitmq-discuss] Consuming multiple messages at a time

Emile Joubert emile at rabbitmq.com
Wed Jun 5 10:10:57 BST 2013


On 04/06/13 18:45, Vijay Lakshmi wrote:
> Is there a way in RabbitMQ where in we enable RabbitMQ to send mutiple
> messages to consumer at a time. In my case there is only one consumer
> per queue. So, by sending mutiple messages to consumer at a time will
> improve my performance.

(I assume by performance you mean throughput and lower overhead rather
than latency.)

You can batch messages by combining multiple logical messages into one
message in the publisher. Consumers will then have to decompose this
message to retrieve individual logical messages. RabbitMQ does not offer
built-in support for this. Bear in mind that the broker deals with
batched rather than the individual component messages for purposes of
message acknowledgement, rejection, TTL, etc.

You should use a message composition/decomposition scheme that makes
sense in your application. Simple concatenation may be sufficient if you
record message boundaries in a header. If messages are in XML format
then you could wrap them in a container element.


More information about the rabbitmq-discuss mailing list