Author |
Message
|
pal |
Posted: Tue Feb 19, 2002 3:36 pm Post subject: |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
I have a situation where a blocking get() call is made with the following get message options:
MQC.MQGMO_WAIT + MQC.MQGMO_SYNCPOINT + MQC.MQGMO_FAIL_IF_QUIESCING
However, while the above get() call waits (no messages in the queue), a disconnect() call is made on this QMgr connection. This call never returns and hence causes the entire application to hang.
Any ideas on how I can resolve this problem? I need to end this qmgr connection regardless of any outstanding get() calls. |
|
Back to top |
|
 |
PeterPotkay |
Posted: Wed Feb 20, 2002 6:03 am Post subject: |
|
|
 Poobah
Joined: 15 May 2001 Posts: 7722
|
Try closing the queue first, then MQDISC???? I don't know if this will work or not; just a guess.
Better yet drop a message in the queue that is a "terminate" message. Either something in the application data says "Close and Disconnect now!" or better yet, use the MQFB_QUIT constant in the MQMD_FEEDBACK field when you put the terminate message. It is our company standard that our apps check for this quit message after each get.
_________________ Peter Potkay
Keep Calm and MQ On |
|
Back to top |
|
 |
pal |
Posted: Wed Feb 20, 2002 8:08 am Post subject: |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
If I put a close() call before the disconnect() it hangs on the close() call that never returns! |
|
Back to top |
|
 |
zpat |
Posted: Wed Feb 20, 2002 8:13 am Post subject: |
|
|
 Jedi Council
Joined: 19 May 2001 Posts: 5866 Location: UK
|
Set the WAIT interval to a modest amount, say 30 seconds. When the MQGET with wait returns with "no message available", check an internal program flag to see if your application is trying to closedown, otherwise re-issue the MQGET with another 30 seconds WAIT (and so on).
That way you don't issue an excessive number of MQGETs, but you can close the application down with an average of 15 seconds before the MQGET will terminate.
|
|
Back to top |
|
 |
pal |
Posted: Wed Feb 20, 2002 4:08 pm Post subject: |
|
|
Apprentice
Joined: 14 Aug 2001 Posts: 35
|
I tried the terminate message as well as the periodic timeout of the get() call in a loop with a flag. Both seem to work, but I am planning to go with the periodic timeout method as that way I don't have to pump any messages into the system.
Thanks folks. Will keep you updated on any problems that I may encounter! |
|
Back to top |
|
 |
|