one thing that could work is to set the maxPageSize for your destinations to 1 via a destination policy, in this way each attempt to dispatch will only dispatch a single message. By default dispatch occurs async, but if you dispatch in the sending thread, you will get ordered dispatch. That is the optimizedDispatch=true destination option. This won't be a very fast setup if messages need to be paged from disk but could get you what you want.
On 4 April 2011 16:39, kapitalx <a...@pagerduty.com> wrote: > Dejan, > > Thanks for the response. I have prefetch limit set to 1. But thats not what > I'm trying to achieve. What I need is the opposite side of round robin. > Currently the queue will send messages round robin to each consumer from > first queue then go to second queue, etc (my consumer is subscribed to all > queues). However, I need 1 message to go from each queue sequentially (I > have hundreds of queues) to a single consumer. So a message from queue 1, > then a message from queue 2, .. and back to queue 1. > > Thanks > > > - Ali > > On Mon, Apr 4, 2011 at 2:36 AM, Dejan Bosanac [via ActiveMQ] < > ml-node+3425012-1916916449-227...@n4.nabble.com> wrote: > >> Try setting small prefetch size (1 or so) so that broker doesn't try to >> send >> a lot of messages from the queue to the consumer in advance. That might >> help >> a bit >> >> http://activemq.apache.org/what-is-the-prefetch-limit-for.html >> >> Regards >> -- >> Dejan Bosanac - http://twitter.com/dejanb >> ----------------- >> The experts in open source integration and messaging - >> http://fusesource.com >> ActiveMQ in Action - http://www.manning.com/snyder/ >> Blog - http://www.nighttale.net >> >> Connect at CamelOne <http://camelone.com/> May 24-26 >> >> The Open Source Integration Conference >> >> >> >> On Sun, Apr 3, 2011 at 8:55 AM, kapitalx <[hidden >> email]<http://user/SendEmail.jtp?type=node&node=3425012&i=0&by-user=t>> >> wrote: >> >> > I have 1 broker, 1 consumer, many queues. the queues are arbitrary such >> as >> > ACCOUNT_ID.1 ACCOUNT_ID.2 etc. I'm trying to avoid 1 account flooding its >> >> > queue and starving the other accounts. >> > >> > If the queues look like this (items in array are the messages) >> > >> > ACCOUNT_ID.1 = [ 1a, 1b, 1c, 1d ] >> > ACCOUNT_ID.2 = [ 2a, 2b, 2c, 2d ] >> > ACCOUNT_ID.3 = [ 3a, 3b, 3c, 3d ] >> > >> > I want the consumer to receive messages in a fair order such as = 1a, 2a, >> >> > 3a, 1b, 2b, 3b, ... >> > >> > roundRobinDispatchPolicy does not achieve this, it seems to be designed >> to >> > alternate messages between multiple consumers, but the single consume >> will >> > just receive = 1a, 1b, 1c, 1d, 2a, 2b ... >> > >> > How would I do this? >> > >> > Thanks. >> > >> > -- >> > View this message in context: >> > >> http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p3423122.html<http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p3423122.html?by-user=t> >> > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >> > >> >> >> ------------------------------ >> If you reply to this email, your message will be added to the discussion >> below: >> >> http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p3425012.html >> To unsubscribe from Queue/Message Fairness as oppose to Client Fairness, >> click >> here<http://activemq.2283324.n4.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=3423122&code=YWxpQHBhZ2VyZHV0eS5jb218MzQyMzEyMnw3NzQxMTg1MTQ=>. >> >> > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Queue-Message-Fairness-as-oppose-to-Client-Fairness-tp3423122p3425851.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. -- http://blog.garytully.com http://fusesource.com