Win a copy of Kotlin in Action this week in the Kotlin forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Retrieve messages with maximum priority  RSS feed

Balaji Natarajan
Posts: 29
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I need to retrieve messages from a queue with maximum priority. Hope i cannot set a MessageSelector query like this 'MAX(JMSPriority)'. Hence, i am creating two message consumers say consumerWithExpeditedPriority with MessageSelector string as 'JMSPriority > 4' and consumerWithNormalPriority with MessageSelector string as 'JMSPriority <= 4'.
First i am attempting to receive through the first consumer and if the message is null, i am trying out the second.
Is this the good way of implementation? Moreover, here i could classify only 2 levels of priority (normal and expedited) since i created two consumers. Actually, i needed all the 10 levels of JMSPriority to be handled out separately.

Please provide your valuable suggestions

Thanks and Regards,
Balaji N
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!