|
RSS Feed - WebSphere MQ Support
|
RSS Feed - Message Broker Support
|
C code to simply PING MQ QueueManager to see if alive? |
« View previous topic :: View next topic » |
Author |
Message
|
gbaddeley |
Posted: Mon Jan 23, 2012 10:15 pm Post subject: |
|
|
 Jedi Knight
Joined: 25 Mar 2003 Posts: 2538 Location: Melbourne, Australia
|
PeterPotkay wrote: |
Even if you come up with the absolute perfect solution for your little app to check if the QM is up, it doesn't mean that 0.000000001 milliseconds after you check and get a good response that the QM can't crash - meaning you have to plan for the QM not being available no matter what you do. |
I completely agree with Peter. I have designed and written a variety of MQ apps over the last 12 years and an "MQ Ping" function was never considered necessary. MQ can go down at any time and you need to cater for any MQ API call failing. You may need to cleanly terminate the app, or do a transaction clean up and reconnect / retry attempt. _________________ Glenn |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 24, 2012 6:19 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
fjb_saper wrote: |
And if you absolutely must check whether a qmgr is available or not, I believe a pcf PING QMGR request is in order...
You'll have to look up the pcf control interface though...
Have fun  |
This is not all that different from other posts where an MQINQ call is issued to determine if there are any messages to consume - before issuing an MQGET. An MQGET alone would have delivered the answer - and a message. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 24, 2012 6:29 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
This is a very different case.
In this case, the connection is being held open for a long period of time with little activity. The intent of the "ping" is to avoid reconnection overhead when new activity starts, or to determine that the entire process should be stopped when the queue manager is unavailable but there is not incoming work that needs it.
As I've mentioned a few times, however, the reconnection facilities in 7.0.1 (or 7.1?) make this kind of manual checking unnecessary.
And, really, the time needed to reconnect to MQ is not that significant, and could indeed be born without much issue when new work arrives. |
|
Back to top |
|
 |
bruce2359 |
Posted: Tue Jan 24, 2012 6:50 am Post subject: |
|
|
 Poobah
Joined: 05 Jan 2008 Posts: 9469 Location: US: west coast, almost. Otherwise, enroute.
|
As has been discussed before, the only way to determine with certainty, at a precise instance in time, if all of the necessary resources are available to complete a transaction is to attempt to complete the transaction.
Absence of a failed qmgr is a great clue. Positive response from the proposed MQPING command will only appear to improve the odds of successfully completing the transaction. _________________ I like deadlines. I like to wave as they pass by.
ב''ה
Lex Orandi, Lex Credendi, Lex Vivendi. As we Worship, So we Believe, So we Live. |
|
Back to top |
|
 |
mqjeff |
Posted: Tue Jan 24, 2012 7:06 am Post subject: |
|
|
Grand Master
Joined: 25 Jun 2008 Posts: 17447
|
bruce2359 wrote: |
As has been discussed before, the only way to determine with certainty, at a precise instance in time, if all of the necessary resources are available to complete a transaction is to attempt to complete the transaction. |
Yes, but if an hour before the next transaction comes in, the queue manager shuts down for the next ten hours, it might be nice to know that and not wait around another hour and shut down until manual intervention.
This is not a completely invalid notion. If it were, for example, then it seems that the reconnect logic wouldn't have been written to support it. |
|
Back to top |
|
 |
|
|
|
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
|
|
|
|