You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by Vadim Pesochinsky <Va...@mscibarra.com> on 2006/06/29 19:35:36 UTC

Wildcard and message distribution

Let's say I have N queues named as follows:

FIN.VAL.MQ1
...
FIN.VAL.MQN

Receiver uses FIN.VAL.MQ* to listen on the queues. Lets say that all queues
are filled up with messages. In what order will reciever be getting
messages? Will it keep getting messages from e.g. FIN.VAL.MQ1 until there
are no more messages in this queue? Is there a policy that can be
configured? I need to round-robin between queues ;-).
-- 
View this message in context: http://www.nabble.com/Wildcard-and-message-distribution-tf1868734.html#a5106986
Sent from the ActiveMQ - User forum at Nabble.com.


Re: Wildcard and message distribution

Posted by James Strachan <ja...@gmail.com>.
On 6/29/06, Vadim Pesochinsky <Va...@mscibarra.com> wrote:
>
> Let's say I have N queues named as follows:
>
> FIN.VAL.MQ1
> ...
> FIN.VAL.MQN
>
> Receiver uses FIN.VAL.MQ* to listen on the queues.

Minor nit - you'd have to use FIN.VAL.* as we don't currently support
the use of * within a name; just to specify a step if you see what I
mean.


>  Lets say that all queues
> are filled up with messages. In what order will reciever be getting
> messages? Will it keep getting messages from e.g. FIN.VAL.MQ1 until there
> are no more messages in this queue?

No, its more kinda random. Basically the wildcard subscription is
kinda interpreted as an aggregation of subscriptions on all the
available queues which match the selector; so the subscription on each
individual queue is independent; though as soon as the consumers
prefetch buffer is filled then other queues can't dispatch to it. So
it will tend to 'chunk' on one destination at a time.

> Is there a policy that can be
> configured? I need to round-robin between queues ;-).

It depends how 'fair' you want to be. If you want to ensure that one
message is processed from each queue one after the other then no we
don't currently support that. One option could be to use a single
queue with round robin dispatch (to ensure things are dispatched
fairly and to avoid one consumer getting 100 messages in sequence)
then using a header/selector if you need to consume only MQ1 etc.

-- 

James
-------
http://radio.weblogs.com/0112098/