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 » Does qm.disconnect() cause QM to go into quiescing state?

Post new topic  Reply to topic
 Does qm.disconnect() cause QM to go into quiescing state? « View previous topic :: View next topic » 
Author Message
BigAl
PostPosted: Tue Apr 17, 2007 6:06 am    Post subject: Does qm.disconnect() cause QM to go into quiescing state? Reply with quote

Newbie

Joined: 17 Apr 2007
Posts: 4

I am new to MQ programming and I am debugging a Java application that has one thread that does a GET on a queue with options to WAIT, and WAIT UNLIMITED, and FAIL IF QUIESCING. Another thread, when requested to do so by a user, attempts to shutdown the application by calling disconnect on the queue manager. According to docs, this seems to make sense. Am I reading this right, that calling disconnect attempts to close all the queues, which I can only guess puts the queue manager into the quiescing state which should cause the GET to fail?

So either I have misunderstood this quiescing thing, or something is not working as it should.

I read in another post here that the 'fail if quiescing' does not apply to MQClients, which is what I am dealing with, but changing to 'binding' did not alter the behavior.

Can anyone clarify this for me?
Back to top
View user's profile Send private message
zpat
PostPosted: Tue Apr 17, 2007 6:16 am    Post subject: Reply with quote

Jedi Council

Joined: 19 May 2001
Posts: 5866
Location: UK

Fail if quiescing does work with clients.

Your explanation sounds wrong, even if it worked it would be extreme to quisce a queue manager just to stop your own application.

Disconnecting one handle won't drop other handles. If you attempt to disconnect another thread's active handle then who knows what might happen but it is not advisable to try this.

The solution is not to issue an unlimited get wait, but to issue a get wait for perhaps five minutes and when the application gets a MQRC 2033 (due to expiry of the interval with no available message), then check for a closedown condition in the application and if set then MQCLOSE and MQDISC otherwise repeat the MQGET with WAIT for another five minutes and so on.

This way you return control to the application every so often. In addition to this the application should respect the queue manager quiescing MQRC and other relevant return codes.
Back to top
View user's profile Send private message
Michael Dag
PostPosted: Tue Apr 17, 2007 6:43 am    Post subject: Reply with quote

Jedi Knight

Joined: 13 Jun 2002
Posts: 2607
Location: The Netherlands (Amsterdam)

qm.disconnect()

disconnects your app from the qm, it does not quiesce the qmgr itself!
_________________
Michael



MQSystems Facebook page
Back to top
View user's profile Send private message Visit poster's website MSN Messenger
BigAl
PostPosted: Tue Apr 17, 2007 6:50 am    Post subject: Reply with quote

Newbie

Joined: 17 Apr 2007
Posts: 4

Michael Dag wrote:
qm.disconnect()

disconnects your app from the qm, it does not quiesce the qmgr itself!


Ah! Great information. So, is there a Java method I can call on the qmgr to quiesce it? Or, is there some other way to quiesce it?
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 17, 2007 6:50 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

Well. qm.disconnect() disconnects the particular handle associated with the MQQueueManager object named qm.

As zpat says, it's not clear what that will do if the handle is currently in use for a GET with WAIT_UNLIMITED. At least not clear to me, or zpat. Maybe it says in the InfoCenter somewhere.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Apr 17, 2007 6:53 am    Post subject: Reply with quote

Grand High Poobah

Joined: 11 Nov 2005
Posts: 26093
Location: Texas, USA

BigAl wrote:
Michael Dag wrote:
qm.disconnect()

disconnects your app from the qm, it does not quiesce the qmgr itself!


Ah! Great information. So, is there a Java method I can call on the qmgr to quiesce it? Or, is there some other way to quiesce it?


There's the command line....

AFAIK you can't quiesce through PCF, but I wait to be corrected on that.
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
BigAl
PostPosted: Tue Apr 17, 2007 6:59 am    Post subject: Reply with quote

Newbie

Joined: 17 Apr 2007
Posts: 4

zpat wrote:
The solution is not to issue an unlimited get wait, but to issue a get wait for perhaps five minutes and when the application gets a MQRC 2033 (due to expiry of the interval with no available message), then check for a closedown condition in the application and if set then MQCLOSE and MQDISC otherwise repeat the MQGET with WAIT for another five minutes and so on.


I agree, and I can get things to work nicely if I do that. However, I have been constrained (until I can convince the client otherwose) to doing the unlimited wait. I am getting close to said convincing as time goes on.

If I can't convince them to let me set the wait interval, my other 'workaround' is to post a 'dummy' message onto the queue in question. That works nicely too.

Thanks for taking the time to share your thoughts. It is much apprecitated.

Al
Back to top
View user's profile Send private message
jefflowrey
PostPosted: Tue Apr 17, 2007 7:00 am    Post subject: Reply with quote

Grand Poobah

Joined: 16 Oct 2002
Posts: 19981

A control message, with a proper Feedback code, is the usual way to end a get with WAIT_UNLIMITED.
_________________
I am *not* the model of the modern major general.
Back to top
View user's profile Send private message
BigAl
PostPosted: Tue Apr 17, 2007 10:39 am    Post subject: Reply with quote

Newbie

Joined: 17 Apr 2007
Posts: 4

jefflowrey wrote:
A control message, with a proper Feedback code, is the usual way to end a get with WAIT_UNLIMITED.


Sweet! It works like a charm.

Thanks for your help!

- Al
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 » Does qm.disconnect() cause QM to go into quiescing state?
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.