|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
Add WAIT/Sleep between Queue Manager Connection |
« View previous topic :: View next topic » |
Author |
Message
|
sijtom0703 |
Posted: Tue Jan 15, 2013 7:41 am Post subject: Add WAIT/Sleep between Queue Manager Connection |
|
|
 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 |
|
 |
Vitor |
Posted: Tue Jan 15, 2013 7:52 am Post subject: Re: Add WAIT/Sleep between Queue Manager Connection |
|
|
 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 |
|
 |
sijtom0703 |
Posted: Tue Jan 15, 2013 8:41 am Post subject: |
|
|
 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 |
|
 |
mqjeff |
Posted: Tue Jan 15, 2013 8:43 am Post subject: |
|
|
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 |
|
 |
sijtom0703 |
Posted: Tue Jan 15, 2013 12:03 pm Post subject: |
|
|
 Voyager
Joined: 28 May 2011 Posts: 84 Location: USA
|
|
Back to top |
|
 |
|
|
 |
|
Page 1 of 1 |
|
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
|
|
|
|