I'm facing some performance issues with MQ XMS.NET library.
My design is as below:
1. GET (Session1, Connection1, IN-QUEUE)
Consumes a message (QUEUEBROWSER) from Inbound and processes it in some other system
2. PUT (Session1, Connection1, OOT-QUEUE)
Put the response from other system into the Outbound
3. DELETE (session 1, Connection 1, IN-QUEUE)
Delete the message from the Inbound
The Put and Delete are too slow.. taking 150 ms per message.
Please suggest what could be the reason.
My connection details for Put:
xmsFactoryOut = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);
// Create WMQ Connection Factory.
connectionFactoryOut = xmsFactoryOut.CreateConnectionFactory();
// Set the properties
if (MQMode == (int)Location.Local)
{
LogMessage($"CreateConnectionOut: MQ Location=Local for Adapter [{Name}]", Tracing.LogCategory.Info, Tracing.LogLevel.NormalLow, null);
}
else if (MQMode == (int)Location.Remote)
{
connectionFactoryOut.SetStringProperty(XMSC.WMQ_HOST_NAME, MQHostName);
connectionFactoryOut.SetIntProperty(XMSC.WMQ_PORT, MQPort);
connectionFactoryOut.SetStringProperty(XMSC.WMQ_CHANNEL, MQChannel);
LogMessage($"CreateConnectionOut: MQ Location=Remote. MQHostName = {MQHostName} MQPort = {MQPort} MQChannel = {MQChannel}", Tracing.LogCategory.Info, Tracing.LogLevel.NormalLow, null);
}
connectionFactoryOut.SetIntProperty(XMSC.WMQ_CONNECTION_MODE, XMSC.WMQ_CM_CLIENT);
connectionFactoryOut.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, MQManagerName);
connectionFactoryOut.SetStringProperty(XMSC.WMQ_QUEUE_NAME, MQQueueNameOut);
// In case of network issues - reconnect to same queue manager
connectionFactoryOut.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_OPTIONS, XMSC.WMQ_CLIENT_RECONNECT_Q_MGR);
connectionFactoryOut.SetStringProperty(XMSC.WMQ_CONNECTION_NAME_LIST, String.Format("{0}({1})", MQHostName, MQPort));
connectionFactoryOut.SetIntProperty(XMSC.WMQ_CLIENT_RECONNECT_TIMEOUT, WakeInterval);
if (!string.IsNullOrEmpty(UserName) && !string.IsNullOrEmpty(Password))
{
connectionFactoryOut.SetStringProperty(XMSC.USERID, UserName);
connectionFactoryOut.SetStringProperty(XMSC.PASSWORD, Password);
}
//base.LogHandler.Invoke($"Properties set just before the connection {MQHostName}", Tracing.LogCategory.Debug, Tracing.LogLevel.DebugMedium, null);
// Create connection.
connectionOut = connectionFactoryOut.CreateConnection();
LogMessage($"CreateConnectionOut: Connection created - {Name}", Tracing.LogCategory.Debug, Tracing.LogLevel.DebugLow, null);
connectionOut.ExceptionListener = new ExceptionListener(OnExceptionOut);
// Create session
sessionOut = connectionOut.CreateSession(false, AcknowledgeMode.AutoAcknowledge);
LogMessage($"CreateConnectionOut: Session created - {Name}", Tracing.LogCategory.Debug, Tracing.LogLevel.DebugLow, null);
destinationOut = sessionOut.CreateQueue(MQQueueNameOut);
destinationOut.SetBooleanProperty(XMSC.WMQ_MQMD_WRITE_ENABLED, true);
LogMessage($"CreateConnectionOut: Destination created - {Name}", Tracing.LogCategory.Debug, Tracing.LogLevel.DebugLow, null);
// Create producer
messagePoducerOut = sessionOut.CreateProducer(destinationOut);
LogMessage($"CreateConnectionOut: Producer created - {Name}", Tracing.LogCategory.Debug, Tracing.LogLevel.DebugLow, null);
connectionOut.Start();
Thanks,Balaji
------------------------------
Balaji Patil
------------------------------