activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Gary Tully <gary.tu...@gmail.com>
Subject Re: JMS Priority
Date Thu, 16 Feb 2012 13:59:13 GMT
Have a peek at the working unit test on trunk for a comparison with
your test case:
http://svn.apache.org/repos/asf/activemq/trunk/activemq-core/src/test/java/org/apache/activemq/store/MessagePriorityTest.java

On 15 February 2012 20:58, Jeremy Levy <jelevy@gmail.com> wrote:
> I'm attempting to test JMS Priority with ActiveMQ 5.5.1 without much
> success and was hoping someone could point out something I am missing.
>
> My test case consists of putting 1000 messages on a queue with a priority
> (being set on both the producer and the message) of 0. Followed by putting
> 100 messages on the queue with a priority of 9. Then start the queue and
> print out the value of a TextMessage which also includes the priority in a
> String simply for debugging purposes.
>
> The result is that I see 1000 messages with the low priority followed by
> the 100 messages of high priority. Whereas I would assume I'd see the 100
> high priority messages mixed it with the 1000 low priority rather then just
> being processed sequentially as they were added to the queue.
>
> The broker is a fresh install of ActiveMQ, I've only made the following
> configuration change in activemq.xml:
>
> ...
>  <policyEntry queue=">" prioritizedMessages="true"
> useConsumerPriority="true">
> ...
>
>
> When I create the queue, I'm using the following parameter
> "?consumer.prefetchSize=5", with the assumption that
> the prioritization happens in the broker, and a prefetched message will
> process once it's at the consumer regardless of prioritization.
>
> I based my configuration mainly on:
>
> http://activemq.apache.org/how-can-i-support-priority-queues.html
>
> Can anyone see what I am missing here?
>
> Jeremy



-- 
http://fusesource.com
http://blog.garytully.com

Mime
View raw message