Reputation: 567
I have an existing XMS .Net client application and I am trying to add the Automatic client reconnect feature to it. This is to fix the application disconnect issue from queue manager often and require application services recycle to restore connection with queue manager. The client version is Version: 7.0.1.1 The XMS Client Product version is 1.2.7.0
But I found the XMS .Net client version 1.2.7 does not support the property XMSC_WMQ_CLIENT_RECONNECT_OPTIONS. Error getting '
IBM.XMS.XMSC' does not contain a definition for 'WMQ_CLIENT_RECONNECT_OPTIONS'
To overcome this I believe the XMS client has to be at least v2.1.0. And for making use of XMS client version 2.1.0 I have to update the MQ client itself to v7.1 but I will be still connecting with MQ v7.0.1 Queue Manager. Will there be any issues connecting to a lower version queue manager from a higher version client or I need to upgrade queue manager to version 7.1 to make use of automatic client reconnect feature in XMS client?
Is there any other better solutions for this issue?
Please find the code changes
public class MQConnectionFactory
{
private static IConnectionFactory cf = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ).CreateConnectionFactory();
public string WMQ_HOST_NAME { set { cf.SetStringProperty(XMSC.WMQ_HOST_NAME, value); } }
public int WMQ_PORT { set { cf.SetIntProperty(XMSC.WMQ_PORT, value); } }
public string WMQ_QUEUE_MANAGER { set { cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, value); } }
public string WMQ_CHANNEL { set { cf.SetStringProperty(XMSC.WMQ_CHANNEL, value); } }
//Adding Client Reconnecting Parameters
public int WMQ_CLIENT_RECONNECT { set { cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT);} }
public int WMQ_CLIENT_RECONNECT_TIMEOUT { set { cf.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, 150);} }
public int WMQ_CONNECTION_MODE
{
set
{
if (value < 0)
value = XMSC.WMQ_CM_CLIENT_UNMANAGED;
cf.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, value);
//set to non RFH header
//cf.SetIntProperty(XMSC.WMQ_TARGET_CLIENT, XMSC.WMQ_TARGET_DEST_MQ);
}
}
public IConnection CreateConnection()
{
//try
//{
return cf.CreateConnection();
//}
//catch (Exception e)
//{
// Console.WriteLine(e);
// return null;
//}
}
}
Upvotes: 1
Views: 1359
Reputation: 15263
Yes, you will need to upgrade the MQ client to v7.1. And this level of MQ client will work with MQ v701 queue manager.
Upvotes: 1