I don't see why you need one high-priority consumer and one medium-priority consumer. Using prioritizedMessages=true already ensures that the broker will hand your consumers the highest priority messages first; just leave it at that.
Also, separating high and low processing isn't a requirement (or at least, it's a dumb requirement); the requirement should be to do something that is meaningful and useful to a user of the system, and separating high and low processing would then be the design chosen for how to meet the requirement. I'm skeptical that you have a "real-world" requirement that is best met by separating high and low processing, and so I think the requirement you've been given is one that shouldn't be met. But I'm certainly open to being proven wrong if there really is such a "real-world" requirement for your system... On Dec 11, 2015 12:51 AM, "frankie_hr" <franjo.zemu...@2e-systems.com> wrote: > Hi Jose, > > I'm using the prioritizedMessages=true because of the JMS grouping feature. > > In the application I'm running, one of the most important features is that > messages with the same group ID are not processed in parallel, thus the > message grouping ensuring the same consumer always gets the message with > the > same ID, so that they are processed sequentially. > > The most recent requirement was to additionally separate processing of > messages with the low and high priority, but by still keeping the message > grouping rule defined above. What I meant to achieve that way was for > different consumers to process low and high priority message, with the same > group ID, but while keeping the sequential message processing order. > > Any other ideas on how to achieve that? > > One other idea of mine was to define a route which would say something like > this: > > from("jms:queue:test?concurrentConsumers=1") > .choice() > .when(header("JMSPriority").isGreaterThanOrEqualTo(4)) > .to("jms:queue:normalPriority") > .otherwise() > .to("jms:queue:lowPriority") > .endChoice(); > > However, in that case, the messages consumed from the normalPriority and > lowPriority queues might be processed in parallel, which I'm trying to > avoid. > > Regards, > Frankie > > > Jose María Zaragoza wrote > > A question about your code: > > > > why do you configure prioritizedMessages= true on your broker and also > > use consumers with a selector parameter ? > > I guess that to use consumers with a selector parameter is for > > avoiding to set prioritizedMessages= true > > > > With prioritizedMessages= true , the broker try to deliver the > > messages in order by priority > > > > It's only curiosity > > > > Regards > > > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Selective-consuming-of-priority-messages-with-message-groups-tp4704813p4704881.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >