Results 1 to 3 of 3

Thread: How to define priority on a message?

  1. #1
    Join Date
    Jul 2012
    Posts
    27

    Default 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. #2
    Join Date
    Oct 2005
    Location
    Boston, MA
    Posts
    2,840

    Default

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

  3. #3
    Join Date
    Jul 2012
    Posts
    27

    Default

    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.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •