ASG
IBM
Zystems
Cressida
Icon
Netflexity
 
  MQSeries.net
Search  Search       Tech Exchange      Education      Certifications      Library      Info Center      SupportPacs      LinkedIn  Search  Search                                                                   FAQ  FAQ   Usergroups  Usergroups
 
Register  ::  Log in Log in to check your private messages
 
RSS Feed - WebSphere MQ Support RSS Feed - Message Broker Support

MQSeries.net Forum Index » IBM MQ Java / JMS » disconnect() on QManager hangs/blocks

Post new topic  Reply to topic
 disconnect() on QManager hangs/blocks « View previous topic :: View next topic » 
Author Message
pal
PostPosted: Tue Feb 19, 2002 3:36 pm    Post subject: Reply with quote

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
View user's profile Send private message
PeterPotkay
PostPosted: Wed Feb 20, 2002 6:03 am    Post subject: Reply with quote

Poobah

Joined: 15 May 2001
Posts: 7716

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
View user's profile Send private message
pal
PostPosted: Wed Feb 20, 2002 8:08 am    Post subject: Reply with quote

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
View user's profile Send private message
zpat
PostPosted: Wed Feb 20, 2002 8:13 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5849
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
View user's profile Send private message
pal
PostPosted: Wed Feb 20, 2002 4:08 pm    Post subject: Reply with quote

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
View user's profile Send private message
Display posts from previous:   
Post new topic  Reply to topic Page 1 of 1

MQSeries.net Forum Index » IBM MQ Java / JMS » disconnect() on QManager hangs/blocks
Jump to:  



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
Protected by Anti-Spam ACP
 
 


Theme by Dustin Baccetti
Powered by phpBB © 2001, 2002 phpBB Group

Copyright © MQSeries.net. All rights reserved.