|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
 |
|
How to check connection availability (ConnectioHealth Check) |
« View previous topic :: View next topic » |
Author |
Message
|
Umarul Farooq |
Posted: Tue Jan 31, 2012 11:42 am Post subject: How to check connection availability (ConnectioHealth Check) |
|
|
Novice
Joined: 15 Jan 2012 Posts: 14
|
Dear All,
Could you please advice to check the Websphere MQ connection availability (ConnectioHealth Check)
I have a multi threaded java processor which will run by 24/7, This processor is having muliple threads to send messages to MQ server.
We need to do connection health check before send messages to Queue.
Thank you. |
|
Back to top |
|
 |
Vitor |
Posted: Tue Jan 31, 2012 12:40 pm Post subject: Re: How to check connection availability (ConnectioHealth Ch |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Umarul Farooq wrote: |
We need to do connection health check before send messages to Queue. |
Why? Why not have the threads report when they encounter a problem and are attempting to recover from it (e.g. when their principle queue manager is unresponsive & they've had to reconnect to the alternate)?
If you already have a 24/7 process in place, it seems redundant to use additional resources. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
Back to top |
|
 |
Umarul Farooq |
Posted: Tue Jan 31, 2012 8:02 pm Post subject: |
|
|
Novice
Joined: 15 Jan 2012 Posts: 14
|
Thank you Vitor.
Yes, Processing thread can identify the connection problem and it can re-establish the connection and send the message to Q.
This connection problem can be identified/ encountered when threads try to send the message to Q.
We have another thread called RecoveryThread, it sole responsibility is to check the connection heart beat in the particular time interval, So that our processing threads always will get/have the healthy connection instead of processing thread itself re-esatablish the connection when encounter the connection problem while sending message to Q.
In this context, How to check the connection heart beat through RecoveryThread.
Thank you very much for advises. |
|
Back to top |
|
 |
mqjeff |
Posted: Wed Feb 01, 2012 3:38 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
Umarul Farooq wrote: |
Thank you Vitor.
Yes, Processing thread can identify the connection problem and it can re-establish the connection and send the message to Q.
This connection problem can be identified/ encountered when threads try to send the message to Q.
We have another thread called RecoveryThread, it sole responsibility is to check the connection heart beat in the particular time interval, So that our processing threads always will get/have the healthy connection instead of processing thread itself re-esatablish the connection when encounter the connection problem while sending message to Q.
In this context, How to check the connection heart beat through RecoveryThread.
Thank you very much for advises. |
Do not design this way, it doesn't help much.
Ignore the recovery thread idea entirely. Put the necessary logic in each of the processing threads to deal with the reconnection and handle any connection errors. |
|
Back to top |
|
 |
Vitor |
Posted: Wed Feb 01, 2012 5:41 am Post subject: |
|
|
 Grand High Poobah
Joined: 11 Nov 2005 Posts: 26093 Location: Texas, USA
|
Umarul Farooq wrote: |
We have another thread called RecoveryThread, it sole responsibility is to check the connection heart beat in the particular time interval, So that our processing threads always will get/have the healthy connection instead of processing thread itself re-esatablish the connection when encounter the connection problem while sending message to Q. |
Why? Unless this thread is checking so frequently it's soaking resources you still can't be certain that the "real" thread will not have problems. To illustrate; this recovery thread checks every 5 minutes, 1 minute after the check there's a problem. Any thread trying to use a queue in the next 4 minutes will still hit a problem. Likewise if the thread checks every 60 seconds.
Which leads me to my second point. When this recovery thread detects a problem, what does it do? How does it notify all the "real" threads that the connection has failed & they need to use the alternate?
It's much easier & cleaner to have the real threads detect the problem, switch to the alternate & notify. _________________ Honesty is the best policy.
Insanity is the best defence. |
|
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
|
|
|
|