0
votes

I've activated prioritizedMessages in the activemq configuration, and priorities work fine, i.e. when I'm sending X messages, half of them with priority 0 and half of them with priority 9, the consumer receives the messages in the correct order.

However, when I'm calling the createConsumer() method with selectors such as CMSPriority > 0 or CMSPriority < 4, no message is received.

Here's the relevant consumer code:

mSession = mConnection->createSession(Session::INDIVIDUAL_ACKNOWLEDGE);
mDestination = mSession->createQueue( mDestURI );
mConsumer = mSession->createConsumer(mDestination, "CMSPriority < 4");

When I change the last line to mConsumer = mSession->createConsumer(mDestination);, all the messages are received, with correct priority.

Can anyone explain this behavior?

1

1 Answers

0
votes

The C++ client won't do any magic to transform the selector statements into normal JMS naming conventions, JMSPriority is the key for the message selector, try using that and see if it solves the issue.