IBM Support

Enabling TCP/IP KeepAlive for IBM MQ on Windows

Troubleshooting


Problem

You want to configure an IBM MQ queue manager in Windows to make use of TCP/IP KeepAlive.

Resolving The Problem

There are 2 steps:
++ Step 1: Configure KeepAlive in Windows
It will affect all applications that use TCP in the Windows server.

This will make IBM MQ aware that you are using KeepAlive.

To configure the KeepAlive parameters, use the following to modify the system registry:
   regedit
Be forewarned that this is a dangerous thing to do (if done incorrectly). You might want to consult with Microsoft before making any changes, as improper registry changes can cripple your system.

Add or modify the following registry keys under the following category.
Then Reboot once completed so new settings can take affect.

HKEY_LOCAL_MACHINE\System\CurrentControlSet\Services\Tcpip\Parameters

The attributes are:

KeepAliveInterval: REG_DWORD = Interval between KeepAlive packets when one is dropped (Measured in milliseconds--the default is 1000 (1 second)).

KeepAliveTime: REG_DWORD = How often TCP attempts to verify the connection Measured in milliseconds--the default is 7200000 (2 hours)

TcpMaxDataRetransmissions: REG_DWORD = Number of retries TCP does for a packet before giving up. The default is 5.


For MQ, reasonable values for these parameters might be 1000, 300000, and 5, respectively.
This would have TCP/IP wait five minutes for data, then send up to five KeepAlive packets, one per second, to verify the connection. If the remote side does not respond, TCP/IP will end the link.

++ Step 2: Enable KeepAlive for the IBM MQ Queue Manager
- Open the MQ Explorer, right click on the queue manager, then properties
- Select TCP
- In the TCP Keepalive drop-down box, choose "Yes"
image-20230504160802-1
For more information, see the online manual:
KeepAlive = YES|NO
Switch the KeepAlive function on or off. KeepAlive=YES causes TCP/IP to check periodically that the other end of the connection is still available.
If it is not, the channel is closed.
This attribute can be read by C, unmanaged .NET, IBM MQ classes for Java, IBM MQ classes for JMS, managed .NET, and managed XMS .NET clients.
 
+++ Related references:
https://www.guidetotcpip.com/wp-content/uploads/files/Appendices/tcpip5e_WindowsRegistrySettings.pdf
Guide to TCP/IP: IPv6 and IPv4, 5th Edition
Windows 7, Windows 10, and Windows Server 2012 R2 Registry Settings
https://support.microsoft.com/en-us/windows/change-tcp-ip-settings-bd0a07af-15f5-cd6a-363f-ca2b6f391ace
Microsoft Support
Change TCP/IP settings
Windows 11 Windows 10 Windows 8.1 Windows 7
TCP/IP defines how your PC communicates with other PCs.
 
+++ end +++

[{"Type":"MASTER","Line of Business":{"code":"LOB45","label":"Automation"},"Business Unit":{"code":"BU059","label":"IBM Software w\/o TPS"},"Product":{"code":"SSYHRD","label":"IBM MQ"},"ARM Category":[{"code":"a8m0z00000008OYAAY","label":"Connectivity-\u003EChannels"}],"ARM Case Number":"TS012598426","Platform":[{"code":"PF033","label":"Windows"}],"Version":"All Versions"}]

Product Synonym

WebSphere MQ WMQ

Document Information

Modified date:
04 May 2023

UID

swg21190501