I have a JMS Client that is sending messages to a Weblogic Queue with priority. To keen matters simple we have 2 priorities set 0 & 9.
On the Server end we have a Spring Application (with a Spring MDP - Message Driven Pojo) deployed on that Queue. Here is the Spring Bean Declaration:
<bean id="jmsContainer" class="org.springframework.jms.listener.DefaultMessageListenerContainer">
<property name="concurrentConsumers" value="20" />
<property name="connectionFactory" ref="jmsFactory" />
<property name="destination">
<bean class="org.springframework.jndi.JndiObjectFactoryBean">
<property name="jndiTemplate" ref="jndiTemplate" />
<property name="jndiName" value="${jms.inbound.queue}" />
</bean>
</property>
<property name="messageListener" ref="appMessageListener" />
</bean>
appMessageListener - Is the class that implements Message listener and has the onMessage method.
TESTING: STOP the application and send 40 requests 20 with priority 0 and 20 with priority 9. START the application.
Expect result is that the MDP should pick and process priority 9 messages first then priority 0 messages.
In reality messages are being picked and processed in random (Most probable the order they came in)
To check if the priority was set or not we print JMSMEssage.getPriority() inside the JMS Listener's onMessage method and it prints the priorities correctly (mix of 20 P9 and 20 P0)
Is the spring DefaultMessageListenerContainer not able to handle JMS Priority ?
Any pointers on this will be appreciated.
App details - Weblogic 11g, Java 1.6, Spring 3.0. All Queues have file stores.