Thanks for visiting the site !!! Visit below intrested Ads to support us if you like the site .Sharing is caring .keep distance and keep safe . Happy Learning ... 😀

WebSphere MQ : How to easily generate Channel Tab & alter it

The client channel definition table (CCDT) determines the channel definitions and authentication information used by client applications to connect to the queue manager.

Ex:It has channel name ,ConnName ,QMGRName,cipher … etc

The purpose of the client channel definition table (CCDT) is to determine the channel definitions used by client applications to connect to the queue manager. The channel definition also specifies the authentication information that applies to the connections.
The CCDT is a binary file. It is generated by a queue manager. The queue manager does not read the CCDT file.

There are a number of ways for a client application to use a CCDT. The CCDT can be copied to the client computer. You can copy the CCDT to a location shared by more than one client. You can make the CCDT accessible to the client as a shared file, while it remains located on the server.

If you use FTP to copy the file, use the bin option to set binary mode; do not use the default ASCII mode. Whichever method you choose to make the CCDT available, the location must be secure to prevent unauthorized changes to the channels.

The CCDT is created when the queue manager is created. Each entry of a CCDT represents a client connection to a specific queue manager. A new entry is added when you define a client-connection channel using the DEFINE CHANNEL command, and the entry is updated when you alter the client-connection channels by using the ALTER CHANNEL command.

The path to the CCDT can be changed by setting MQCHLLIB. If you do set MQCHLLIB, be aware, if you have multiple queue managers on the same server, they share the same CCDT location.

On Linux/AIX
/var/mqm/qmgrs/QUEUEMANAGERNAME/@ipcc
On Windows
MQ_INSTALLATION_PATH\data\qmgrs\QUEUEMANAGERNAME\@ipcc

MQCHLTAB specifies the name of the file containing the client channel definition table (ccdt). The default file name is AMQCLCHL.TAB.

On Windows:
SET MQCHLTAB=filenameCopy code
On UNIX and Linux® systems:
export MQCHLTAB=filename

Let us create a chaneel tab file for the below connection from QMGR

DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
[mqm@ip-172-31-14-154 ~]$ runmqsc APPQM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager APPQM1.


DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
     1 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
AMQ8014I: IBM MQ channel created.
DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
     2 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(SVRCONN) TRPTYPE(TCP) 
AMQ8014I: IBM MQ channel created.
end
     3 : end
2 MQSC commands read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@ip-172-31-14-154 ~]$

AMCLCHL.TAB file is a binary file . If we view we can see connection information but cannot read complete file .

Now if i want to create another Channel tab from the same QMGR with different channel then it is difficult because this file will be modified or updated with all the channel information from the QMGR .

From the Latest version onwards we have an easy way to generate Channel Tab using runmsc -n command .
By default runmqsc -n Look for the channle tab in /var/mqm . If we run this command then it will read the file from that location if exist otherwise it will create new so that we can update the definitons of channels that we intended to create for Application connectivity .

Note: We only need SVRCONN on QMGR Side . CLNTCONN is only need for Application that used CHLTAB file . so we will define only CLNTCONN on channel tab file .

[mqm@ip-172-31-14-154 @ipcc]$ cd /var/mqm
[mqm@ip-172-31-14-154 ~]$ ls -lrt
total 24
drwxrwsr-x.  3 mqm mqm   19 Dec 29 15:56 conv
drwxrwsr-x.  2 mqm mqm    6 Dec 29 15:56 config
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 web
drwxrwsrwx.  2 mqm mqm    6 Dec 29 15:56 trace
-rw-rw-r--.  1 mqm mqm 1941 Dec 29 15:56 service.env
drwxrwsr-x.  5 mqm mqm   53 Dec 29 15:56 mqft
drwxrwsr-x.  4 mqm mqm   32 Dec 29 15:56 shared
-rw-rw-r--.  1 mqm mqm  661 Dec 29 15:56 mqclient.ini
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 exits
drwxrwsr-x.  3 mqm mqm   27 Dec 29 15:56 exits64
drwxrwsr-x. 15 mqm mqm  177 Jan  4 11:44 sockets
drwxrwsr-x. 15 mqm mqm  177 Jan  4 11:44 qmgrs
-rw-rw-r--.  1 mqm mqm 3674 Jan  4 11:44 mqs.ini
drwxrwsr-x. 14 mqm mqm  162 Jan  4 11:44 log
drwxrwsrwx.  2 mqm mqm 8192 Jan  9 07:06 errors
[mqm@ip-172-31-14-154 ~]$ 
[mqm@ip-172-31-14-154 ~]$ runmqsc -n
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting local MQSC for 'AMQCLCHL.TAB'.

dis chl(*)
     1 : dis chl(*)
AMQ9518E: File '/var/mqm/AMQCLCHL.TAB' not found.
end
     2 : end
No commands have a syntax error.
[mqm@ip-172-31-14-154 ~]$ 

This is when try to read a channel tab if the file diesnot exist . Let’s create one .refer below

[mqm@ip-172-31-14-154 ~]$ runmqsc -n
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting local MQSC for 'AMQCLCHL.TAB'.


DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
     1 : DEFINE CHANNEL(CL.APPQM1) CHLTYPE(CLNTCONN) TRPTYPE(TCP) CONNAME('172.31.14.154(1417)') QMNAME(APPQM1) 
AMQ8014I: IBM MQ channel created.
dis chl(*)
     2 : dis chl(*)
AMQ8414I: Display Channel details.
   CHANNEL(CL.APPQM1)                      CHLTYPE(CLNTCONN)
dis chl(*) all
     3 : dis chl(*) all
AMQ8414I: Display Channel details.
   CHANNEL(CL.APPQM1)                      CHLTYPE(CLNTCONN)
   AFFINITY(PREFERRED)                     ALTDATE(2021-01-10)
   ALTTIME(05.53.51)                       CERTLABL( )
   CLNTWGHT(0)                             COMPHDR(NONE)
   COMPMSG(NONE)                           CONNAME(172.31.14.154(1417))
   DEFRECON(NO)                            DESCR( )
   HBINT(300)                              KAINT(AUTO)
   LOCLADDR( )                             MAXMSGL(4194304)
   MODENAME( )                             PASSWORD( )
   QMNAME(APPQM1)                          RCVDATA( )
   RCVEXIT( )                              SCYDATA( )
   SCYEXIT( )                              SENDDATA( )
   SENDEXIT( )                             SHARECNV(10)
   SSLCIPH( )                              SSLPEER( )
   TPNAME( )                               TRPTYPE(TCP)
   USERID( )                            
end
     4 : end
One command has a syntax error.
[mqm@ip-172-31-14-154 ~]$ 

Now see the channel tab is created .

[mqm@ip-172-31-14-154 ~]$ ls -lrt /var/mqm/AMQCLCHL.TAB 
-rw-rw-r--. 1 mqm mqm 2106 Jan 10 05:53 /var/mqm/AMQCLCHL.TAB
[mqm@ip-172-31-14-154 ~]$ 

If you want to create in different location then we have to set MQCHLLIB.

For Windows:
SET MQCHLLIB=pathname
For UNIX and Linux systems:
export MQCHLLIB=pathname

Migration and client channel definition tables (CCDT)
In general, the internal format of the client channel definition table might change from one release level of IBM WebSphere MQ to the next. As a result, an IBM WebSphere MQ MQI client can use a client channel definition table only when it has been prepared by a server queue manager that is at the same release level as the client, or at an earlier release level.

If we generate a CHLTAB and try to use in Older version of client it may not work . Take the working TAB file and edit using runmqsc -n then modify then it should work fine .

Related Posts

Leave a Reply

Your email address will not be published. Required fields are marked *