I've never used message priority, so most of what I know comes from reading what others like Art have written about it, but I believe that as long as all of those messages fit in memory or in the cursor you're using to read from the persistent store (if applicable), the selectors will cause consumer 2 to ignore all the priority 8 messages and go straight to the priority 6 ones. But if there were enough messages unconsumed on the queue that some of them didn't fit into the cursor because of all the other unconsumed messages, they won't get dispatched to consumer 2 until there's room to pull them into the cursor.
I can't say for sure that that's right (hopefully someone else will correct me if it isn't), but that's my understanding of it. So do test the behavior yourself, and see if that lines up with what you observe during your tests. On Thu, Jan 29, 2015 at 7:03 PM, asarkari <abhinav.sark...@gmail.com> wrote: > Here is my use case.. > > I have two producers sending messages to a queue and there are two > consumers > on this queue. > > Producer one sets a message header on the message e.g. MyName=one and > priority 8. > > Producer two sets message header MyName=two and priority 6. > > The consumers use message selector MyName="one" and MyName="two". > > The producers are continuously sending messages and consumers are also > active. > > Lets say at certain stage, the queue has 10 messages with header value one > and priority 8 and 5 messages with header value two and priority 6. > > Now what happens.. does the consumer 2 instantly receive the 5 messages > that > it is eligible to receive via message selector or it would receive these > only after consumer one has consumed the other 10 messages which had higher > priority.. > > > Essentially, my question is how does the broker handle message selection > and > priority i.e. which one gets applied first. I went through Active MQ docs > but couldn't find an answer. > > I can test the behavior myself, but would that always be consistent? Does > Active MQ has a clear working on priority and message selection? > > > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/Message-priority-and-message-selector-Active-MQ-version-5-4-tp4690692.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. >