|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Sending stop message to get with unlimited wait |
« View previous topic :: View next topic » |
Author |
Message
|
Liza |
Posted: Wed Nov 16, 2005 3:19 am Post subject: Sending stop message to get with unlimited wait |
|
|
Newbie
Joined: 16 Jun 2005 Posts: 4
|
I am trying to implement an MQ trigger monitor (I know, IBM has one but we have reasons to implement our own). All it has to do, is listen on a specific queue and start up an other application as soon as a message arrive. To use as little CPU as possible, I have set the wait property on the get method to unlimted.
But as it is a service I also want to be able to shut it down gracefully. I can't however do anything on the queue or queue manager as it is blocked by the get method.
I can see from the discussions here, that there is really only one way to stop a blocking get which is set to wait unlimited - by putting a message on the queue.
My problem now is, that even if I start a new thread with a new queue manager instance, I am not abble to put at message on the queue, because it is already opened for input (and I can't close is since it's blocked).
I'm using Windows and .NET
Any help would be appreciated. |
|
Back to top |
|
 |
zpat |
Posted: Wed Nov 16, 2005 3:27 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Why not use a MQGMO WAIT interval of say 60 seconds. Then check for closedown conditions when you get a 2033.
Re-issuing the MQGET every 60 seconds is not likely to cause much overhead.
Alternatively use FAIL_IF_QUIESCING option on MQGMO if you want the MQGET WAIT to be terminated when the queue manager is quiescing. |
|
Back to top |
|
 |
wschutz |
Posted: Wed Nov 16, 2005 3:32 am Post subject: |
|
|
 Jedi Knight
Joined: 02 Jun 2005 Posts: 3316 Location: IBM (retired)
|
You could code your TM to examine the trigger messages, and if it receives a message with the code MQFB_QUIT, then it gracefully closes the queue, disconnects from the queue manager and then goes away.
Then, a simple little program to generate a zero lenght messages which contains the Feeback code MQFB_QUIT in the MQMD.
Or.... you could just set "get(disabled)" on the queue your TM is monitoring and then shutdown after the TM gets the MQRC_GET_DISABLED return code. _________________ -wayne |
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|
|
|