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 » Add WAIT/Sleep between Queue Manager Connection

Post new topic  Reply to topic
 Add WAIT/Sleep between Queue Manager Connection « View previous topic :: View next topic » 
Author Message
sijtom0703
PostPosted: Tue Jan 15, 2013 7:41 am    Post subject: Add WAIT/Sleep between Queue Manager Connection Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

Hi,

I am writing error handling code in Java for WebSphere MQ. I need to put a WAIT Time between each time Queue Manager Disconnects and Reconnect. How can I do that. Is implementing Threads and Sleep time is the only option with WebSphere MQ classes for Java

Code:

private static void connectToQmgr(MQQueueManager qMgr, MQQueue queue){
      
      try{

          //put messages and get messages
                                    disconnectFromQmgr(qMgr,queue);
       
      } catch (MQException e){
         
         e.printStackTrace();
              System.out.println("A WebSphere MQ Error occured : Completion Code " + e.completionCode + " Reason Code " + e.reasonCode);
              if (e.reasonCode == 2009){
              
              disconnectFromQmgr(qMgr, queue);
              
              //Add wait Time
              
              connectToQmgr(qMgr, queue);
           }
         
      }
Back to top
View user's profile Send private message
Vitor
PostPosted: Tue Jan 15, 2013 7:52 am    Post subject: Re: Add WAIT/Sleep between Queue Manager Connection Reply with quote

Grand High Poobah

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

sijtom0703 wrote:
I need to put a WAIT Time between each time Queue Manager Disconnects and Reconnect. How can I do that. Is implementing Threads and Sleep time is the only option with WebSphere MQ classes for Java


So you want your Java code to wait between 2 MQ operations, i.e. while your Java code is not within any of the MQ class code and want to know if there's anything you can do inside the MQ code?

Doesn't sound likely to me. Sounds like you need a more native Java solution, like SLEEP
_________________
Honesty is the best policy.
Insanity is the best defence.
Back to top
View user's profile Send private message
sijtom0703
PostPosted: Tue Jan 15, 2013 8:41 am    Post subject: Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

Yes Vitor
I am looking for a code within MQ API which can implement delay between two MQ operations. If that is not likely I will have to use the Native Sleep in Java
Back to top
View user's profile Send private message
mqjeff
PostPosted: Tue Jan 15, 2013 8:43 am    Post subject: Reply with quote

Grand Master

Joined: 25 Jun 2008
Posts: 17447

sijtom0703 wrote:
Yes Vitor
I am looking for a code within MQ API which can implement delay between two MQ operations. If that is not likely I will have to use the Native Sleep in Java


The only operation that supports any kind of wait is MQGET.
Back to top
View user's profile Send private message
sijtom0703
PostPosted: Tue Jan 15, 2013 12:03 pm    Post subject: Reply with quote

Voyager

Joined: 28 May 2011
Posts: 84
Location: USA

Thanks mqjeff
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 » Add WAIT/Sleep between Queue Manager Connection
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.