How to manipulate JMSPriority

Posted by smahanta on 25-Oct-2010 01:16

We are using sonic ESB for a SMS messaging application.Input is a xml which is having an element PRIORITY.

<!ELEMENT PRIORITY (#PCDATA)>   <!-- integer 1 to 10 (1 highest) -->

We want to map it to JMSPriority - <PRIORITY>1</PRIORITY> will map to JMSPriority 9 ,  <PRIORITY>10</PRIORITY> will map to JMSPriority 0 etc.

How can we explicitly manipulate priority? Will that be honored? That is, will higher priority message will be delivered ahead of lower priority ones? Currently we are not setting any priority leading to messages having default priority i.e 4.

Legacy application was database-centric and there it was easy to honor priorities.

Please help.

Regards,

Subhendu

All Replies

Posted by Bill Wood on 29-Oct-2010 12:54

I believe you need a separate Endpoint for each priority.  That is Priority is specified in the Endpoint.

It is only done on values to the endpoint, so it is not preserved across SonicESB services (each with their own endpoint)

Posted by smahanta on 29-Oct-2010 18:51

Hi William

Thanks for the help.

After posting this question, I found a similar one already answered in this forum.So I have replaced the destination endpoint with 10 endpoints based on priority. Also whereas earlier there was only one service instance listenting at the destination endpoint now there are 10 - one for each end-point. But that is not the final destination. For the next service there is only one destination, ie with default JMSPriority 4.I am not sure what to do now. Replace the second end-point with a set of 10 end-points? Or be content that for half the journey high priority messages got preference over low priority ones?

Regards,

Subhendu

Posted by Bill Wood on 31-Oct-2010 23:25

I think that is what you need to do (be content with only 1/2 the itinerary).   You could look at how to use dynamic endpoints, but I would think that is too much trouble.

Posted by tsteinbo on 01-Nov-2010 10:52

To add to Bill's comments:

We also support inherited priority, e.g. whatever the priority is that came in goes out. That will do for the second part of your itinerary.

Thomas

This thread is closed