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 » MQQueueManager will not disconnect until waitInterval done

Post new topic  Reply to topic Goto page 1, 2  Next
 MQQueueManager will not disconnect until waitInterval done « View previous topic :: View next topic » 
Author Message
dustoff
PostPosted: Tue Oct 12, 2004 12:43 pm    Post subject: MQQueueManager will not disconnect until waitInterval done Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

Looking for advice.

My MQQueueManager will not disconnect until the waitInterval that I set (60 seconds ) has completed on the get().

I studied this forum and applied the MQC.MQOO_FAIL_IF_QUIESCING option that was shown to be the problem in other similiar situations.

Still having the problem.

Have MQSeries for Java v5.2.2

Here is my code for the open:

Code:

MQEnvironment.hostname = this.outHost;
MQEnvironment.port     = this.outPort;
MQEnvironment.channel  = this.outChannel;

mgr = new MQQueueManager( this.outMgrName );

out = mgr.accessQueue( this.outQueueName, MQC.MQOO_OUTPUT | MQC.MQOO_FAIL_IF_QUIESCING, null, null, null );


Thanks!

Any suggestions is appreciated!

dustoff
Back to top
View user's profile Send private message
dustoff
PostPosted: Tue Oct 12, 2004 12:51 pm    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

<idiot>
In my original posting I grabbed the wrong code, which was for the output queue which I was expirementing with. Posted below is code for creating the input queue. Sorry for any confusion.
</idiot>

Code:

MQEnvironment.hostname = this.inHost;
MQEnvironment.port     = this.inPort;
MQEnvironment.channel  = this.inChannel;

mgr = new MQQueueManager( this.inMgrName );

in = mgr.accessQueue(  this.inQueueName, MQC.MQOO_INPUT_SHARED | MQC.MQOO_FAIL_IF_QUIESCING, null, null, null );
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Oct 12, 2004 12:52 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

What is your problem?????

Are you wanting not to wait for 60 seconds... then change the wait time.
Back to top
View user's profile Send private message Send e-mail Visit poster's website
siliconfish
PostPosted: Tue Oct 12, 2004 12:53 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

If you set the wait interval on get to 60 sec, GET will wait untill the end of 60 sec and then completes the call - it will not "disconnect" from the queue manager.
MQC.MQOO_FAIL_IF_QUIESCING applies to the situation in which the queue manager is Quiescing.

Quote:
If the queue manager enters the quiescing state, and you used the MQGMO_FAIL_IF_QUIESCING option, the wait is canceled and the MQGET call completes with the MQRC_Q_MGR_QUIESCING reason code. Without this option, the call remains waiting.

_________________
siliconfish
Back to top
View user's profile Send private message
dustoff
PostPosted: Tue Oct 12, 2004 12:54 pm    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

vennela wrote:
What is your problem?????

Are you wanting not to wait for 60 seconds... then change the wait time.


I don't want to wait up to 60 seconds to disconnect.

Thanks!
Back to top
View user's profile Send private message
vennela
PostPosted: Tue Oct 12, 2004 1:07 pm    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Post the code where you do the get

I do this and the program never waits if there is no message

Code:

MQMessage outMessage = new MQMessage();
         outQueue.get(outMessage);
Back to top
View user's profile Send private message Send e-mail Visit poster's website
dustoff
PostPosted: Tue Oct 12, 2004 1:09 pm    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

The problem that I am having is that when I want to restart my Tomcat server, I use a ServletContextListener that attempts to shutdown the MQQueueManager. When I perform MQQueueManager.disconnect() this thread hangs on the disconnect until the MQQueue.get() completes its wait interval.

I would prefer to not decrease the waitInterval. To me that would seem like kludging what I am trying to do. There should be a provision in MQQueueManager to disconnect immediately, which is what the fail_if_quiescing option, from my understanding, is suppose to do.

Hope that clarifies. Thanks!
Back to top
View user's profile Send private message
dustoff
PostPosted: Tue Oct 12, 2004 1:14 pm    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

Here is my get routine:

Code:

public MQMessage get() throws MQException {

   MQMessage msg = new MQMessage();

   try {

      MQGetMessageOptions msgOptions = new MQGetMessageOptions();
      msgOptions.options = MQC.MQGMO_WAIT;
      msgOptions.waitInterval = 60000; 

      in.get( msg, msgOptions, 2000 );

   } catch (MQException ex) {

      if ( ex.reasonCode != 2033 ) {
         this.isInOpen = false;
         throw ex;
      }

   }

   return msg;

}
Back to top
View user's profile Send private message
bower5932
PostPosted: Tue Oct 12, 2004 1:25 pm    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

Why don't you send yourself a terminate message? You can do it before issuing the disconnect. The get will retrieve the message and end which should allow the disconnect to complete.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
EddieA
PostPosted: Tue Oct 12, 2004 1:51 pm    Post subject: Reply with quote

Jedi

Joined: 28 Jun 2001
Posts: 2453
Location: Los Angeles

You need the FAIL_IF_QUIESCING on the GMO as well. That option only works on the call it is coded on, so setting it on the OPEN only has effect for the OPEN. Not subsequent calls.

Cheers,
_________________
Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0
Back to top
View user's profile Send private message
siliconfish
PostPosted: Tue Oct 12, 2004 2:08 pm    Post subject: Reply with quote

Master

Joined: 12 Aug 2002
Posts: 203
Location: USA

I don't think that any of the QUIESCING options work here, as the actual queue manager is not ending, its only the java queue manager object that is being disconnected.
_________________
siliconfish
Back to top
View user's profile Send private message
JLRowe
PostPosted: Wed Oct 13, 2004 1:27 am    Post subject: Reply with quote

Yatiri

Joined: 25 May 2002
Posts: 664
Location: South East London

You are blocked on a get on one thread, and are attempting to do a disconnect on another. All access to the queue manager is serialized, so your disconnect will wait until the get has finished.

I should think your only option is to reduce the wait interval.
Back to top
View user's profile Send private message Send e-mail
dustoff
PostPosted: Wed Oct 13, 2004 7:55 am    Post subject: Reply with quote

Newbie

Joined: 12 Oct 2004
Posts: 9

Everybody, thanks for your responses!

I am getting conflicting messages from the group though.

Some are saying that MQGMO_FAIL_IF_QUIESCING in the gmo options should solve my problem. However when I apply this, it still hangs on the MQQueueManager.disconnect(). At this point, it appears that jlrowe and siliconfish are correct in their judgments that input queue blocks on get().

Is it possible the FAIL_IF_QUIESCING does not work for MQSeries for Java?

I am leaning towards bower5932 suggestion of sending a terminate message to the queue.

I have never connected to my own client input queue. Do you just have to create a new queue manager pointint to localhost? Is there example code out there that demonstrates this. Sorry for being so naive, but have only connected to MQServer.

Thanks!
Back to top
View user's profile Send private message
vennela
PostPosted: Wed Oct 13, 2004 8:06 am    Post subject: Reply with quote

Jedi Knight

Joined: 11 Aug 2002
Posts: 4055
Location: Hyderabad, India

Quote:

If the queue manager enters the quiescing state, and you used the MQGMO_FAIL_IF_QUIESCING option, the wait is canceled and the MQGET call completes with the MQRC_Q_MGR_QUIESCING reason code. Without this option, the call remains waiting.


When somebody does endmqm (to stop the QMGR) then the QMGR goes to QUIESCING mode. The QMGR will stop after all the outstanding work is done (your MQGET with wait mode is one such thing). Now if somebody tries to OPEN (or GET I think) with the option FAIL_IF_QUIESCING the call fails with MQRC_Q_MGR_QUIESCING.

BUT, if you have already issued MQGET, then MQGMO_FAIL_IF_QUIESCING will not help.

Quote:
Some are saying that MQGMO_FAIL_IF_QUIESCING in the gmo options should solve my problem.

You might have understood it that way but you got it wrong.

Quote:
Is it possible the FAIL_IF_QUIESCING does not work for MQSeries for Java?


It sure does but it will not solve your problem
Back to top
View user's profile Send private message Send e-mail Visit poster's website
bower5932
PostPosted: Wed Oct 13, 2004 8:56 am    Post subject: Reply with quote

Jedi Knight

Joined: 27 Aug 2001
Posts: 3023
Location: Dallas, TX, USA

dustoff wrote:

I have never connected to my own client input queue. Do you just have to create a new queue manager pointint to localhost? Is there example code out there that demonstrates this.


You can find a sample (mqhash.java I believe) on:

http://www.developer.ibm.com/tech/sampmq.html

You put the connection information into a hash table and then issue the connect.
Back to top
View user's profile Send private message Send e-mail Visit poster's website AIM Address Yahoo Messenger
Display posts from previous:   
Post new topic  Reply to topic Goto page 1, 2  Next Page 1 of 2

MQSeries.net Forum Index » IBM MQ Java / JMS » MQQueueManager will not disconnect until waitInterval done
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.