Defining a TCP connection on Windows
Define a TCP connection by configuring a channel at the sending end to specify the address of the target, and by running a listener program at the receiving end.
Before you begin
A message channel that uses TCP/IP can be pointed at an IBM® Aspera® faspio Gateway, which provides a fast TCP/IP tunnel that can significantly increase network throughput. A queue manager running on any entitled platform can connect through an Aspera gateway. The gateway itself is deployed on Red Hat® or Ubuntu Linux®, or Windows. See Defining an Aspera gateway connection on Linux or Windows.
Sending end
Specify the host name, or the TCP address of the target machine, in the Connection name field of the channel definition.
The port to connect to defaults to 1414. Port number 1414 is assigned by the Internet Assigned Numbers Authority to IBM MQ.
DEFINE CHANNEL('channel name') CHLTYPE(SDR) +
TRPTYPE(TCP) +
CONNAME('OS2ROG3(1822)') +
XMITQ('XMitQ name') +
REPLACE
where
OS2ROG3
is the DNS name of the remote queue manager and 1822
is
the port required. (This must be the port that the listener at the receiving end is listening on.) A running channel must be stopped and restarted to pick up any change to the channel object definition.
TCP:
Port=1822
- The port number explicitly specified in the channel definition or command line. This number allows the default port number to be overridden for a channel.
- The port attribute specified in the TCP stanza of the .ini file. This number allows the default port number to be overridden for a queue manager.
- The default value of 1414. This is the number assigned to IBM MQ by the Internet Assigned Numbers Authority for both inbound and outbound connections.
For more information about the values you set using qm.ini, see Configuration file stanzas for distributed queuing.
Receiving on TCP
To start a receiving channel program, a listener program must be started to detect incoming network requests and start the associated channel. You can use the IBM MQ listener.
Receiving channel programs are started in response to a startup request from the sending channel.
To start a receiving channel program, a listener program must be started to detect incoming network requests and start the associated channel. You can use the IBM MQ listener.
To run the Listener supplied with IBM MQ, that starts new channels as threads, use the runmqlsr command.
runmqlsr -t tcp [-m QMNAME] [-p 1822]
QMNAME
is not required for the
default queue manager, and the port number is not required if you are using the default (1414). The
port number must not exceed 65535. - The port number explicitly specified in the channel definition or command line. This number allows the default port number to be overridden for a channel.
- The port attribute specified in the TCP stanza of the .ini file. This number allows the default port number to be overridden for a queue manager.
- The default value of 1414. This is the number assigned to IBM MQ by the Internet Assigned Numbers Authority for both inbound and outbound connections.
For the best performance, run the IBM MQ listener as a trusted application as described in Running channels and listeners as trusted applications. See Restrictions for trusted applications for information about trusted applications
Using the TCP/IP SO_KEEPALIVE option
TCP:
KeepAlive=yes
For more information about the SO_KEEPALIVE option, see Checking that the other end of the channel is still available.
On Windows, the HKLM\SYSTEM\CurrentControlSet\Services\Tcpip\Parameters registry value for the Windows KeepAliveTime option controls the interval that elapses before the connection is checked. The default is two hours.
Using the TCP listener backlog option
In TCP, connections are treated incomplete unless three-way handshake takes place between the server and the client. These connections are called outstanding connection requests. A maximum value is set for these outstanding connection requests and can be considered a backlog of requests waiting on the TCP port for the listener to accept the request.
See Using the TCP listener backlog option on IBM MQ for Multiplatforms for more information, and the specific value for Windows.