Author |
Message
|
kash3338 |
Posted: Tue Jun 02, 2009 4:41 am Post subject: Inserting at beginning of queue (top of queue) |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Hi,
Is there any way by which i can insert a message at the beginning of the queue through my ESQL code?
Though the basic concept of queue is FIFO, there is something called as Double-Ended queue. I just want to know if this kind of concept is available in MQ-MB, to insert a message at the beginning of the queue rather than at the end? |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 02, 2009 4:44 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
The only mechanism available is the message priority. Note that the sending application doesn't "insert" the message in WMQ, the software delivers it. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Jun 02, 2009 4:53 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
Vitor wrote: |
The only mechanism available is the message priority. Note that the sending application doesn't "insert" the message in WMQ, the software delivers it. |
Can you please explain me how to set the Message Priority for each message? |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jun 02, 2009 4:55 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
kash3338 wrote: |
Vitor wrote: |
The only mechanism available is the message priority. Note that the sending application doesn't "insert" the message in WMQ, the software delivers it. |
Can you please explain me how to set the Message Priority for each message? |
With a SET statement, at least in ESQL. That sets the Priority field, on the MQ Message Descripter.
Doing this is meaningless unless the app reading the queue is using priority. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jun 02, 2009 4:58 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
kash3338 wrote: |
Vitor wrote: |
The only mechanism available is the message priority. Note that the sending application doesn't "insert" the message in WMQ, the software delivers it. |
Can you please explain me how to set the Message Priority for each message? |
It's a property of the message, set according to how the language you're using deals with the MQMD (it's a different method between C & Java for instance). _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
kash3338 |
Posted: Tue Jun 02, 2009 5:37 pm Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
How do i set the priority of a message in MQMD through ESQL? |
|
Back to top |
|
 |
AkankshA |
Posted: Tue Jun 02, 2009 7:50 pm Post subject: |
|
|
 Grand Master
Joined: 12 Jan 2006 Posts: 1494 Location: Singapore
|
SET OutputRoot.MQMD.Priority = <number you want to assign>
but make sure receiving application is picking the message in priority order and not in FIFO _________________ Cheers |
|
Back to top |
|
 |
fjb_saper |
Posted: Tue Jun 02, 2009 8:00 pm Post subject: |
|
|
 Grand High Poobah
Joined: 18 Nov 2003 Posts: 20756 Location: LI,NY
|
kash3338 wrote: |
Can you please explain me how to set the Message Priority for each message? |
Your question doesn't make much sense. If you set priority on each message they will still be delivered FIFO within the priority.
A queue is not a stack. May be you would be better served with message expiry.  _________________ MQ & Broker admin |
|
Back to top |
|
 |
kash3338 |
Posted: Wed Jun 03, 2009 4:56 am Post subject: |
|
|
Shaman
Joined: 08 Feb 2009 Posts: 709 Location: Chennai, India
|
AkankshA wrote: |
SET OutputRoot.MQMD.Priority = <number you want to assign>
but make sure receiving application is picking the message in priority order and not in FIFO |
Hi AkankshA, Thanks for your reply. I just want to know this,
How can we get the messages by priority through MQGet? |
|
Back to top |
|
 |
zpat |
Posted: Wed Jun 03, 2009 5:45 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
You don't.
MQ will present them in priority order if the queue is so ordered (and you don't use other match criteria).
It's possible to make an application use priority with NO code changes by using alias queues for different MQPUT apps with different default priority values and the receiver queue has priority order.
As if by magic - you can get different priority by simply choosing a different alias queue name for the PUT. |
|
Back to top |
|
 |
|