Author |
Message
|
santosh.veerlapati |
Posted: Tue Jun 02, 2009 4:40 am Post subject: message priority not working |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
Hi
I have a queue that has properties depicted below
general: default priority :0
Extended:Message Delivery Sequence:priority
and i m communicating to this queue and queue manager through Java program using MQ API
and i m setting message priority like below
JMSTextMessage message = (JMSTextMessage) session.createTextMessage(ss);
message.setJMSPriority( ;
but the priority based storing or retriving is not working..
when i retrive the message its
jms priority is telling 4 for all messages that i have sent eventhough i sent with different jmspriorities..
can anybody help me on this
thanks in advance
santosh kumar veerlapati |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 02, 2009 4:47 am Post subject: Re: message priority not working |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
santosh.veerlapati wrote: |
jms priority is telling 4 for all messages that i have sent eventhough i sent with different jmspriorities..
|
Are you saying that the retrieved message has a priority of 4 even if it was sent with a priority of 8, or that the messages are being presented to your application in the wrong sequence?
Or are you just setting the value in the message rather than the send? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Tue Jun 02, 2009 4:50 am Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
yes u r correct
the retrieved message has a priority of 4 even if it was sent with a priority of 8or 6 or 2 or anything |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 02, 2009 4:52 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
But were they delivered in the correct sequence? _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Tue Jun 02, 2009 5:32 am Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
the messages are sitting on the queue in which the order i sent , not depending upon the priority |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 02, 2009 5:34 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
santosh.veerlapati wrote: |
the messages are sitting on the queue in which the order i sent , not depending upon the priority |
Not the question I asked. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Tue Jun 02, 2009 5:39 am Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
the messages are delivered in the correct sequence(the order in which i sent ) |
|
Back to top |
|
 |
sumit |
Posted: Tue Jun 02, 2009 7:32 am Post subject: |
|
|
Partisan
Joined: 19 Jan 2006 Posts: 398
|
santosh.veerlapati wrote: |
the messages are delivered in the correct sequence(the order in which i sent ) |
When you explain 'correct sequence', then what's the use of setting priority? Priority means messages should be delivered in order of their priority but not in order they were placed into the queue.
Can you please explain what's the exact problem you are facing? More the description, better the responses. _________________ Regards
Sumit |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 02, 2009 3:38 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
Verify the default settings of the JMS / JNDI setup.
Make sure it says APP Defined and not default or MQ defined.
You can also set the priority in the JNDI and define multiple JNDI name for the same base queue name. The difference would be the priority setting.
You can then use those multiple JNDI name to retrieve the Queue object and you will have 1 Queue object per priority....
Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Tue Jun 02, 2009 9:20 pm Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
exactly
When you explain 'correct sequence', then what's the use of setting priority? Priority means messages should be delivered in order of their priority but not in order they were placed into the queue.
thats what my problem is ... |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Wed Jun 03, 2009 1:49 am Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
yes
If i m using
MQQueue queue = (MQQueue) session.createQueue("queue:///HubQueue");
queue.setPriority(5 );
the message went to the queue is containig the same priority (i.e 5) i have mentioned.
But when i use
MQQueue queue = (MQQueue) session.createQueue("queue:///HubQueue");
queue.setPriority(JMSC.MQJMS_PRI_APP );
and
JMSTextMessage message = (JMSTextMessage) session.createTextMessage(ss);
message.setJMSPriority(5);
the message send is not having priority 5, it contains the default priority of 4
why in this way it is not working
can anybody help me out in this
thanks in advance
santosh kumar veerlapati |
|
Back to top |
|
 |
fjb_saper |
Posted: Wed Jun 03, 2009 7:49 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
I believe you would have to set the priority on the producer / sender.
Generally the destination setting will override all. Read up in the manuals to find by what exact order of priority you can set this value. Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
santosh.veerlapati |
Posted: Wed Jun 03, 2009 10:20 pm Post subject: |
|
|
Voyager
Joined: 19 Jun 2008 Posts: 87
|
i want to set the default priority for the desitnation(MQueue) and producer(MQSender) and
priority should work on the Message i have set like below
JMSTextMessage message = (JMSTextMessage) session.createTextMessage(ss);
message.setJMSPriority(1);
whichever i m giving priority for the message using message.setJmsPriority()
that should be the final priority for the message i m sending
for that what i need to do |
|
Back to top |
|
 |
fjb_saper |
Posted: Thu Jun 04, 2009 8:32 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
santosh.veerlapati wrote: |
i want to set the default priority for the desitnation(MQueue) and producer(MQSender) and
priority should work on the Message i have set like below
JMSTextMessage message = (JMSTextMessage) session.createTextMessage(ss);
message.setJMSPriority(1);
whichever i m giving priority for the message using message.setJmsPriority()
that should be the final priority for the message i m sending
for that what i need to do |
But that is not how it works. A Destination override superseeds the value assigned to the message. A sender value may supersede it as well. That is why I'm telling you to read the relevant passage in the manuals... Have fun  _________________ MQ & Broker admin |
|
Back to top |
|
 |
|