MQ Connection - 2009 error

Posted by user171523 on Stack Overflow See other posts from Stack Overflow or by user171523
Published on 2010-06-01T16:22:59Z Indexed on 2010/06/02 4:13 UTC
Read the original article Hit count: 313

Filed under:
|

am connectting the MQ with below code. I am able connected to MQ successfully. My case is i place the messages to MQ every 1 min once. After disconnecting the cable i get a ResonCode error but IsConnected property still show true. Is this is the right way to check if the connection is still connected ? Or there any best pratcices around that.

I would like to open the connection when applicaiton is started keep it open for ever.

public static MQQueueManager ConnectMQ() {

if ((queueManager == null) || (!queueManager.IsConnected)||(queueManager.ReasonCode == 2009)) { queueManager = new MQQueueManager(); } return queueManager; }

© Stack Overflow or respective owner

Related posts about connection

Related posts about ibm-mq