Topic
  • 3 replies
  • Latest Post - ‏2013-01-15T04:02:29Z by Shashikanth@BLR
SystemAdmin
SystemAdmin
8523 Posts

Pinned topic MQ Client automatic reconnect Failure .net client

‏2013-01-12T12:19:30Z |
Hi,

I am facing issues while trying automatic reconnect to MQ once the MQ is up after failure.
Here are the steps I am taking for above -
1. Push messages to queue
2. Keep the connection open and shut down the queue manager.
3. It fails but the connection is still open.
4. Start the queue manager and push the messages again.
5. It fails.

Though starting a new instance of the client works.

Below are the configuration on the server and the client -
Server - 7.0.1.4
Client - 7.1

I have an application(.net) where I am pushing my messages to queue. It working fine in all normal conditions.
But I have to make sure that if there is issue while connecting to the QUEUE my application should be able to reconnect with client without opening the connection again.
My Client is a simple .Net Application and I am using XMSC factory to connect to MQ.

I have updated the MQClient.ini file with below configurations -
CHANNELS:
MQReconnectTimeout=150
DefRecon=YES

it does not seem to be working.

I am using XMSC factory to connect to MQ.

I am adding below attributes to the factory -

connectionFactory.SetStringProperty(XMSC.WMQ_HOST_NAME, queueParams.getHostName());
connectionFactory.SetIntProperty(XMSC.WMQ_PORT, queueParams.getPortNumber());
connectionFactory.SetStringProperty(XMSC.WMQ_CHANNEL, queueParams.getSSLChannel());
connectionFactory.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT_UNMANAGED);
connectionFactory.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, queueParams.getQueueManager());
connectionFactory.SetStringProperty(XMSC.WMQ_SSL_KEY_REPOSITORY, @queueParams.getSslRepository());
connectionFactory.SetStringProperty(XMSC.WMQ_SSL_CIPHER_SPEC, @queueParams.getSslCipherSpec());

If I add below code
connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT) ;
connectionFactory.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 150);

I get MQ error code - 2012 and not able to connect to MQ.

Please let me know if I need to add any additional code in my client.

Thanks in advance.

-Prakash
Updated on 2013-01-15T04:02:29Z at 2013-01-15T04:02:29Z by Shashikanth@BLR
  • Shashikanth@BLR
    Shashikanth@BLR
    132 Posts

    Re: MQ Client automatic reconnect Failure .net client

    ‏2013-01-14T04:19:07Z  
    You mention if you enable reconnect options on connection factory the client application is not connecting. But you have mentioned in the beginning "It working fine in all normal conditions.". Can you clarify? Is it that when you enable options you application
    1) Does not connect to queue manager at all?
    2) Initial connection is fine but fails to reconnect after queue manager failure or network issue etc?
  • SystemAdmin
    SystemAdmin
    8523 Posts

    Re: MQ Client automatic reconnect Failure .net client

    ‏2013-01-14T09:35:55Z  
    You mention if you enable reconnect options on connection factory the client application is not connecting. But you have mentioned in the beginning "It working fine in all normal conditions.". Can you clarify? Is it that when you enable options you application
    1) Does not connect to queue manager at all?
    2) Initial connection is fine but fails to reconnect after queue manager failure or network issue etc?
    What I meant was the client was able to make connection with MQ without the code changes for automatic reconnection once I add the code for reconnect client does not even connect with Queue and throws 2012.

    When I enable the autmatic reconnect option throgh MQClient.ini file change -

    1. Launch Client, it connects to MQ (keep the client alive).
    2. Shut down the queue manager and again try connecting, it fails.
    3. Start new instance of client, it connects to queue successfully.
  • Shashikanth@BLR
    Shashikanth@BLR
    132 Posts

    Re: MQ Client automatic reconnect Failure .net client

    ‏2013-01-15T04:02:29Z  
    What I meant was the client was able to make connection with MQ without the code changes for automatic reconnection once I add the code for reconnect client does not even connect with Queue and throws 2012.

    When I enable the autmatic reconnect option throgh MQClient.ini file change -

    1. Launch Client, it connects to MQ (keep the client alive).
    2. Shut down the queue manager and again try connecting, it fails.
    3. Start new instance of client, it connects to queue successfully.
    Thanks. As you are using SSL, it appears that the issue is with SSL initialization when reconnection is attempted. You can further narrow down the issue by turning off SSL and test reconnection. If that works then the issue is with SSL initialization. Then it may be worth opening a PMR with IBM.