Announcement Announcement Module
Collapse
No announcement yet.
How to define priority on a message? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • How to define priority on a message?

    Hi.
    if I want messages on queues to be handled according to priority,
    it seems like the only thing that works is to call:
    Code:
     jmsTemplate.setPriority
    before each send with the required priority.
    However, there is also a configuration on the AMQ broker:
    prioritizedMessages
    Code:
    <destinationPolicy>
                <policyMap>
                 <policyEntries>
    			<policyEntry queue=">" prioritizedMessages="true">
    This seems to have no influence on anything from my testings.
    Should this be used or is it enough to set the jms template?

    thanks

  • #2
    You need to also enable QoS on that template by setting the 'explicitQosEnabled' property to true.

    Comment


    • #3
      I know. i did, this is why the jmsTemplate.setPriority works.
      However, i don't understand what is the use for setting the prioritizedMessages in the activemq xml. is this needed or is it enough to set the jms template with a priority?
      And is there a way to set the message itself with a priority instead of jmstemplate? when i did
      Code:
      message.setJMSPriority
      it did not work.

      Comment

      Working...
      X