0

I am trying to set the MQCD structure properties - specifically HeartBeatInterval using XMS.NET API.

Background: I have client applications (in .NET) using XMS.NET API to read messages from WebSphere MQ. I use the ClientAcknowledge mode. If the client reads the message and does not ack it, WebSphere MQ waits for 300 seconds before timing out and makes (backout) the message available in the original queue for other clients to read the message.

Task: I want to lower the timeout from 300 seconds.

Our MQ Admin suggested to change the HearBeatInterval property on the channel. But changing it is making no difference.

Apparently, somehow setting the Channel's HeartBeatInterval property on client side (along with the server side channel setting) will make it work. I am attempting to set this value in the client application. But the XMS API does not have a property that corresponds to MQCD.HeartBeatInterval property

Any insight in accomplishing this task of lowering the message ack timeout? or even setting the HeartBeatInterval on the client side - if that's the way to do it.

  • Why do you want to lower the timeout? why not ack the message? – Shashi Oct 01 '14 at 14:27
  • We do Ack the message in a normal flow. But we want to handle the scenario when the client hangs up abnormally without ack'ing. We want other client instances to be able to process the message sooner than wait 300 seconds before message is available back in the queue. We run multiple client application instances in a load balanced setup. Any idea of how to lower this timeout? – screenname Oct 02 '14 at 13:46

2 Answers2

0

Certainly it is true that the actual negotiated value of heartbeat interval will takes the biggest number out of the client side and server side heartbeat values, I.e. will use the least frequent interval. If you want a shorter interval you will need to change both ends.

Rather than coding it in your application, why not use a CCDT? This is more flexible should you change you mind about the value to use and want to lower it or raise it in the future.

Further Reading

  1. Using a client channel definition table with .NET
Morag Hughson
  • 7,255
  • 15
  • 44
0

I think you can use the Disconnect interval(DISCINT) attribute of the server connection channel to terminate connections from applications that are hanging. By default DISCINT is set to 0 which means it's disabled. You can set a value that suits your requirement. Read more here: http://www-01.ibm.com/support/knowledgecenter/SSFKSJ_7.5.0/com.ibm.mq.ref.con.doc/q081860_.htm

Here is a sample snippet for using CCDT in XMS .NET application.

        // Get an instance of factory.
        factoryFactory = XMSFactoryFactory.GetInstance(XMSC.CT_WMQ);

        // Create WMQ Connection Factory.
        cf = factoryFactory.CreateConnectionFactory();

        // Use CCDT URL for client connection.
        cf.SetStringProperty(XMSC.WMQ_QUEUE_MANAGER, "QM1");
        cf.SetStringProperty(XMSC.WMQ_CCDTURL, "file://C:\\ProgramData\\IBM\\MQ\\qmgrs\\QM1\\@ipcc\\AMQCLCHL.TAB");

        // Create connection.
        connectionWMQ = cf.CreateConnection();
Shashi
  • 14,980
  • 2
  • 33
  • 52