Author |
Message
|
tgregg |
Posted: Tue Oct 14, 2003 2:55 pm Post subject: MQSeries re connect problem |
|
|
Newbie
Joined: 14 Oct 2003 Posts: 3 Location: Atlanta
|
What calls do we have to make in our client program to recover from the remote server being stopped and restarted?
we are attempting to close the queue, disconnect from the qmgr, reconnect and reopen before issuing the get or put but we cant' recover.
using pymq client with NT / W 2000, TCP / IP connection to unknown remote server.
Thanks |
|
Back to top |
|
 |
clindsey |
Posted: Wed Oct 15, 2003 5:23 am Post subject: |
|
|
Knight
Joined: 12 Jul 2002 Posts: 586 Location: Dallas, Tx
|
If the qmgr bounces, your next api call should return 2009, MQRC_CONNECTION_BROKEN. Then your connection handle is no longer valid so you cannot close the queue or disconnect. Just reconnect and then reopen the queue. This only works for a pure client connection, e.g. a socket connection. If you are connected in server bindings, e.g. a shared memory connection, your application has to be closed before the
queue manager will restart.
Charlie |
|
Back to top |
|
 |
EddieA |
Posted: Wed Oct 15, 2003 1:25 pm Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
You could also use the Fail if Quiescing option to be notified if the Queue Manager is terminating.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
tgregg |
Posted: Tue Oct 28, 2003 8:24 am Post subject: |
|
|
Newbie
Joined: 14 Oct 2003 Posts: 3 Location: Atlanta
|
we do use the quiescing option and get an error that says the gmgr is stopping.
what should we do then?
close? disconnect? or just try to reconnect until the qmgr comes back up?
thanks for the help so far. |
|
Back to top |
|
 |
EddieA |
Posted: Tue Oct 28, 2003 9:57 am Post subject: |
|
|
 Jedi
Joined: 28 Jun 2001 Posts: 2453 Location: Los Angeles
|
You would at least have to terminate any connections to the QM, because even if you waited for it to come back up, the connection handles would be invalid.
What you do after cleaning up is down to the design of your application/system.
Cheers, _________________ Eddie Atherton
IBM Certified Solution Developer - WebSphere Message Broker V6.1
IBM Certified Solution Developer - WebSphere Message Broker V7.0 |
|
Back to top |
|
 |
tgregg |
Posted: Wed Oct 29, 2003 4:26 am Post subject: |
|
|
Newbie
Joined: 14 Oct 2003 Posts: 3 Location: Atlanta
|
dlindsays says if i get the 2009 error i shouldn't close and disconnect because handle is invalid. Are you saying if i get the qmg_stopping error i should close and disconnect before attempting to reconnect?
i appreciate the point about design, but i think my problem is one of making the right calls in the right order to keep mq happy. right now only solution is restarting the app, so at least i am connecting correctly. i just don't think i am making the right calls in the right order when it fails.
thanks again for the patience and help |
|
Back to top |
|
 |
dgolding |
Posted: Wed Oct 29, 2003 7:56 am Post subject: |
|
|
 Yatiri
Joined: 16 May 2001 Posts: 668 Location: Switzerland
|
Hi Tom,
I did a quick test with a modified AMQSGET (not client, I must admit, but it should be the same) - I did a GET with FAIL_IF_QUIESCING, then close, then disconnect, then sleep and reattempt the MQCONN again.
This worked fine - I shut the queue manager down while the prog was in the MQGET wait, then after the disconnect (while it was sleeping) I restarted the queue manager - and the connect seem to work fine.
HTH |
|
Back to top |
|
 |
techno |
Posted: Wed Oct 29, 2003 9:21 am Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
What is the equivalent option to QUIESCING in MQ Base Java?
Thanks |
|
Back to top |
|
 |
bower5932 |
Posted: Wed Oct 29, 2003 10:48 am Post subject: |
|
|
 Jedi Knight
Joined: 27 Aug 2001 Posts: 3023 Location: Dallas, TX, USA
|
There is an MQC.MQOO_FAIL_IF_QUIESCING that you can add to your openOptions on the MQQueueManager. You can also add it to the options of your MQGetMessageOptions which you pass into the get. |
|
Back to top |
|
 |
techno |
Posted: Wed Oct 29, 2003 11:00 am Post subject: |
|
|
Chevalier
Joined: 22 Jan 2003 Posts: 429
|
I am sorry. I should have asked for the equivalent options in JMS. Could you let me know?
Thanks
Shiva. |
|
Back to top |
|
 |
|