Author |
Message
|
uliss |
Posted: Thu Feb 12, 2009 9:58 pm Post subject: Send messages with delay |
|
|
Apprentice
Joined: 10 Jan 2007 Posts: 27
|
Hi everybody,
Hi want to send a message to a queue. There is something reading from this queue so all the messages are processed automaticaly. But I need to know how to send a message with a delay incorporated in the MQ header. For example, some messages have to stay "sleeping" in the queue during a time, for example 10 seconds. ¿Is there any MQ header to do this?
Thank you very much |
|
Back to top |
|
 |
MQEnthu |
Posted: Thu Feb 12, 2009 10:14 pm Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Quote: |
But I need to know how to send a message with a delay incorporated in the MQ header. Is there any MQ header to do this? |
No there is no such field in MQMD.But why do you need to lock the message for few sec.. what is the requirement _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
uliss |
Posted: Thu Feb 12, 2009 11:05 pm Post subject: |
|
|
Apprentice
Joined: 10 Jan 2007 Posts: 27
|
The requirement is:
The broker send messages to a destination queue. From this queue there is a program reading messages. The program works with the messages and sometimes need to re-send some messages (not all of them) to the queue. But these messages have to wait for a time in the queue (10 seconds). They want to know if they can write any MQ header field in these messages to indicate that the messages have to wait "slept" in the queue and reactivate later.
Another option is that the program could wait for a time before send the message to the queue. But I need to know if the first option is possible.
Thank you very much |
|
Back to top |
|
 |
uliss |
Posted: Thu Feb 12, 2009 11:29 pm Post subject: |
|
|
Apprentice
Joined: 10 Jan 2007 Posts: 27
|
Hi, ¿could it be the MQGMO header, field WaitInterval?
Anybody knows how does this field work?
Thank you |
|
Back to top |
|
 |
MQEnthu |
Posted: Fri Feb 13, 2009 12:56 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Quote: |
Hi, ¿could it be the MQGMO header, field WaitInterval?
Anybody knows how does this field work? |
The MQGMO is get message option is used with MQGET (while reading the message from queue). If you want to wait before getting/browsing the next message, you can set the waitInterval in the MQGET call. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
MQEnthu |
Posted: Fri Feb 13, 2009 1:03 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Quote: |
They want to know if they can write any MQ header field in these messages to indicate that the messages have to wait "slept" in the queue and reactivate later. |
Sorry, I could not understand why you have to lock the messages in queue for few seconds . However you can lock the messages in queue by making the queue GET inhibit. There by making sure the messages are not read by the application. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
Vitor |
Posted: Fri Feb 13, 2009 1:42 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
MQEnthu wrote: |
Quote: |
Hi, ¿could it be the MQGMO header, field WaitInterval?
Anybody knows how does this field work? |
The MQGMO is get message option is used with MQGET (while reading the message from queue). If you want to wait before getting/browsing the next message, you can set the waitInterval in the MQGET call. |
No you can't!
The wait interval is the maximum time the call will wait before returning not the time it will wait before getting. If there's an eligable message on the queue, MQGET will always return immediately. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
MQEnthu |
Posted: Fri Feb 13, 2009 2:38 am Post subject: |
|
|
 Partisan
Joined: 06 Oct 2008 Posts: 329 Location: India
|
Quote: |
The wait interval is the maximum time the call will wait before returning not the time it will wait before getting. If there's an eligable message on the queue, MQGET will always return immediately. |
Sorry.. I should have written, MQGET call waits for the suitable/specified message to arrive. And call returns immediately if the desired message is available. _________________ -----------------------------------------------
It is good to remember the past,
but don't let past capture your future |
|
Back to top |
|
 |
|