Before creating a sever connection channel, you will need two queue managers, where one queue manager will be on the machine that is sending the message, and the other queue manager is on the machine that is receiving the message. The sender should have a local transmission queue and a remote queue definition, and the receiver should have a remote queue.
If using MQ Explorer
On machine 2 (the receiver), create the receiver connection channel.
- In the left panel of MQ Explorer, expand Queue Managers > Machine 2 (the receiver).
- Right-click on the Channels folder and select New > Receiver Channel.
- In the Name field, type MANAGER01.MANAGER02 and select Finish. Replace these with the name of your managers.
On machine 1 (the sender), create the sender connection channel.
- In the left panel of MQ Explorer, expand Queue Managers > Machine 1 (the sender).
- Right-click on the Channels folder and select New > Sender Channel.
- In the Name field, type MANAGER01.MANAGER02 and select Next. Replace "manager01.manager02" with any name you would like to use.
- At the next prompt, enter the remote queue manager hostname, port, and manager, and select Finish.
- Connection name is hostname(port) of the machine 1 (the receiver).
- Transmission queue is the name of the local transmission queue.
- Right-click on the channel and select Start.
In this example, a channel is created between manager01 and manager02.
If using Linux command line
Determine if port 1414 is available. If 1414 is being used, determine if port 1415 is available, then 1416, until you local an available port.
~]# netstat -an | grep 1414
Switch to the mqm user.
~]# su - mqm
Start the MQSC utility for the queue manager that you want to set up the server connection channel on. In this example, MANAGER02 is the name of the queue manager.
~]# /opt/mqm/bin/runmqsc MANAGER02
Create a server connection channel. In this example, a server connection channel named CHANNEL02 is created.
define channel(CHANNEL02) chltype(SVRCONN) trptype(TCP)
Display the channel.
Define a new listener for the channel.
define listener (LISTENER02) trptype(TCP) control(QMGR) port(1414)
Start the listener.
Exit the MQSC utility.
Return to your user account.