Create a channel
Create two channel definitions, one at each end of the connection. You create the first channel definition at the first queue manager. Then you create the second channel definition at the second queue manager, on the other end of the link.
Both ends must be defined using the same channel name. The two ends must have compatible channel types, for example: Sender and Receiver.
To create a channel definition for one end of the link use the MQSC command DEFINE CHANNEL. Include the name of the channel, the channel type for this end of the connection, a connection name, a description (if required), the name of the transmission queue (if required), and the transmission protocol. Also include any other attributes that we want to be different from the system default values for the required channel type, using the information you have gathered previously.
You are provided with help in deciding on the values of the channel attributes in Channel attributes.
Note: You are recommended to name all the channels in your network uniquely. Including the source and target queue manager names in the channel name is a good way to do this.Create channel example
DEFINE CHANNEL(QM1.TO.QM2) CHLTYPE(SDR) + DESCR('Sender channel to QM2') + CONNAME(QM2) TRPTYPE(TCP) XMITQ(QM2) CONVERT(YES)
In all the examples of MQSC the command is shown as it appears in a file of commands, and as it is typed in UNIX, Linux, and Windows. The two methods look identical, except that to issue a command interactively, we must first start an MQSC session. Type runmqsc, for the default queue manager, or runmqsc qmname where qmname is the name of the required queue manager. Then type any number of commands, as shown in the examples.
For portability, restrict the line length of our commands to 72 characters. Use the concatenation character, +, as shown to continue over more than one line:- On Windows use Ctrl-z to end the entry at the command line.
- On UNIX and Linux, use Ctrl-d.
- Alternatively, on UNIX, Linux, and Windows, use the end command.
Parent topic: Getting started with objects