[rabbitmq-discuss] Reading multiple messages in RabbitMQ

Emile Joubert emile at rabbitmq.com
Thu Jul 21 10:56:26 BST 2011


Hi Demiss,

On 20/07/11 15:50, Demi Zike wrote:
> Hi,
> 
> I use Subscription from the RabbitMQ.Client.MessagePatterns namespace to
> subscribe to multiple queues. I then read messages based on the
> subscription (code below). However, I am not able to read messages other
> than the first one.

I assume that element.Next() is blocking on one of the subscriptions.
You could retrieve deliveries from each subscription with a timeout to
read past it. Alternatively you could set up a single queue to receive
all measurements and retrieve messages from it with a single subscription.

The best setup will depend on how frequently measurements are expected,
whether they are correlated, whether other consumers also need to
observe them, and so on. A list of subscriptions is probably not ideal
in most cases.


-Emile


More information about the rabbitmq-discuss mailing list