We re currentyly developping an application using JMS and activemq (5.5.1). We would like to define a higher priority for some messages, which would make them consumed first. After setting the producer and the consumer (through spring (3.1) JMSTemplate), the priority does not fully work. Indeed, when we "turn off" the consumer, and send some messages, the priority is respected, but when we add messages while the consumer is on, the messages are received in the same order they were sent.
组合非常简单:
优先工作已在现成的汇合文档中启动:
<policyEntries>
<policyEntry queue=">" prioritizedMessages="true"/>
...
</policyEntries>
生产者模板组合也使QoS成为可能:
<bean id="jmsOCRTemplate" class="org.springframework.jms.core.JmsTemplate">
<property name="connectionFactory" ref="connectionFactory" />
<property name="defaultDestination" ref="destination_ocr" />
<property name="explicitQosEnabled" value="true" />
</bean>
为了发出一个高度优先的信息,我们只是改变生产者方面的模板优先财产:
template.setPriority(9);
任何想法? 难道这种正常行为,或者我们是否会忘记某种组合?