How to setup and use MQIPT

MQIPT is a simplest configuration, MQIPT acts as an IBM MQ protocol forwarder. It listens on a TCP/IP port and accepts connection requests from IBM MQ channels.

If a well-formed request is received, MQIPT establishes a further TCP/IP connection between itself and the destination IBM MQ queue manager. It then passes all protocol packets it receives from its incoming connection on to the destination queue manager, and it returns protocol packets from the destination queue manager back to the original incoming connection.

No change to the IBM MQ protocol (client/server or queue manager to queue manager) is involved because neither end is directly aware of the presence of the intermediary. New versions of the IBM MQ client or server code are not required.

To use MQIPT, the caller channel must be configured to use the MQIPT host name and port, not the host name and port of the destination queue manager. This is defined with the CONNAME property of the IBM MQ channel. MQIPT reads the incoming data and simply passes it through to the destination queue manager. Other configuration fields, such as the user ID and password in a client/server channel, are similarly passed to the destination queue manager.

Multiple queue managers
MQIPT can be used to allow access to more than one destination queue manager. For this to work, there must be a mechanism to tell MQIPT which queue manager to connect to, so MQIPT uses the incoming TCP/IP port number to determine which queue manager to connect to.

You can therefore configure MQIPT to listen on multiple TCP/IP ports. Each listening port is mapped to a destination queue manager through an MQIPT route. You can define up to 100 such routes, which associate a listening TCP/IP port with the host name and port of the destination queue manager. This means that the host name (IP address) of the destination queue manager is never visible to the originating channel. Each route can handle multiple connections between its listening port and destination, each connection acting independently.

MQIPT configuration file
MQIPT uses a configuration file called mqipt.conf. This file contains definitions of all routes and their associated properties. See Administering and configuring MQIPT for more information about mqipt.conf.

When MQIPT is launched, it starts each route that is listed in the configuration file. Messages are written to the system console showing the status of each route. When message MQCPI078 is shown for a route, that route is ready to accept connection requests.

MQIPT Installation :

Note MQIPT is no more supported on Solaris from 9.2 onwards .

MQIPT is available as supplementary from MQ 9.1 onwards

Download MQIPT from IBM site . Downloaded xzvf 9.1.5.0-IBM-MQIPT-LinuxX64.tar.gz . Upload the file to the server and extract in the desired location .

cd /apps/
tar xzvf 9.1.5.0-IBM-MQIPT-LinuxX64.tar.gz 
This will be extracted to mqipt
  cd mqipt/
  ls -lrt
  cd bin  --> MQIPT Bin locaion 
  ./mqiptVersion --> TO check MQIPT Version
  cd ..
  ls -lrt
  cd samples/
  ls -lrt
  vi mqiptSample.conf 

our case /apps/mqipt used as Installation location ( Extracted tar here) . copy mqiptSample.conf to /apps/mqipt as mqipt.conf
update the routes in mqipt.conf file ass per the requirement then start using below command

cd /apps/mqipt/bin/ ; nohup ./mqipt /apps/mqipt &

/apps/mqipt is the mqipt home where default mqipt.conf file located

QM1 –> MQIPT –> QM2

mqm@ip-172-31-14-154 ~]$ runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager QM1.
define chl(QM1.TO.QM2) chltype(sdr) conname(‘172.31.14.154(1417)’) xmitq(MQIPTTEST)
2 : define chl(QM1.TO.QM2) chltype(sdr) conname(‘172.31.14.154(1417)’) xmitq(MQIPTTEST)
AMQ8014I: IBM MQ channel created.
define q(MQIPTTEST) usage(xmitq)
3 : define q(MQIPTTEST) usage(xmitq)

define ql(MQIPTTEST) usage(xmitq)
4 : define ql(MQIPTTEST) usage(xmitq)
AMQ8006I: IBM MQ queue created.

end
5 : end
4 MQSC commands read.
2 commands have a syntax error.
All valid MQSC commands were processed.
[mqm@ip-172-31-14-154 ~]$

[mqm@ip-172-31-14-154 ~]$ runmqsc QM2
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager QM2.

define chl(QM1.TO.QM2) chltype(rcvr)
1 : define chl(QM1.TO.QM2) chltype(rcvr)
AMQ8014I: IBM MQ channel created.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@ip-172-31-14-154 ~]$

[mqm@ip-172-31-14-154 ~]$ runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager QM1.

start chl(QM1.TO.QM2)
1 : start chl(QM1.TO.QM2)
AMQ8018I: Start IBM MQ channel accepted.
end
2 : end
One MQSC command read.
No commands have a syntax error.
All valid MQSC commands were processed.
[mqm@ip-172-31-14-154 ~]$

Modify mqipt.conf for the Route . Route will have information for the listening port for the route to accept incoming trafic and Destination ,port for outbound traffic to send

start mqipt with mqipt config file .

Sample Route from mqipt.conf file looks like below


[route]
Name=Sample one
Active=true
ListenerPort=1417
Destination=172.31.14.154
DestinationPort=1415


We can have up to 100 such routs can be configured in mqipt

[root@ip-172-31-14-154 bin]# nohup ./mqipt /apps/mqipt &
[1] 2450
[root@ip-172-31-14-154 bin]# nohup: ignoring input and appending output to ‘nohup.out’

[root@ip-172-31-14-154 bin]# tail -f nohup.out
5724-H72 (C) Copyright IBM Corp. 2000, 2020 All Rights Reserved
MQCPI001 IBM MQ Internet Pass-Thru V9.1.5.0 starting
MQCPI004 Reading configuration information from mqipt.conf
MQCPI022 Password checking has been disabled on the command port
MQCPI011 The path /apps/mqipt/logs will be used to store the log files
MQCPI144 MQ Advanced capabilities not enabled
MQCPI006 Route 1417 is starting and will forward messages to :
MQCPI034 ….172.31.14.154(1415)
MQCPI035 ….using MQ protocols
MQCPI078 Route 1417 ready for connection requests

Now MQIPT is ready to accept incoming at 1417 and forward to 172.31.14.154(1415) as configured in mqipt.conf route

Now verify the channel status on QM1

[mqm@ip-172-31-14-154 errors]$ runmqsc QM1
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager QM1.

dis chs() 1 : dis chs()
AMQ8417I: Display Channel Status details.
CHANNEL(QM1.TO.QM2) CHLTYPE(SDR)
CONNAME(172.31.14.154(1417)) CURRENT
RQMNAME( ) STATUS(RETRYING)
SUBSTATE( ) XMITQ(MQIPTTEST)

NOTE: If there are force reboot of the server and channel is still in retryign state then channel can be stopped ,reset and start to bring back to running state
:
stop chl(QM1.TO.QM2)
2 : stop chl(QM1.TO.QM2)
AMQ8019I: Stop IBM MQ channel accepted.
reset chl(QM1.TO.QM2)
3 : reset chl(QM1.TO.QM2)
AMQ8023I: IBM MQ channel reset.

start chl(QM1.TO.QM2)
4 : start chl(QM1.TO.QM2)
AMQ8018I: Start IBM MQ channel accepted.

dis chs() 5 : dis chs()
AMQ8417I: Display Channel Status details.
CHANNEL(QM1.TO.QM2) CHLTYPE(SDR)
CONNAME(172.31.14.154(1417)) CURRENT
RQMNAME(QM2) STATUS(RUNNING)
SUBSTATE(MQGET) XMITQ(MQIPTTEST)

Verify the receiver channel at QM2
[mqm@ip-172-31-14-154 errors]$ runmqsc QM2
5724-H72 (C) Copyright IBM Corp. 1994, 2020.
Starting MQSC for queue manager QM2.

dis chs() 1 : dis chs()
AMQ8417I: Display Channel Status details.
CHANNEL(QM1.TO.QM2) CHLTYPE(RCVR)
CONNAME(172.31.14.154) CURRENT
RQMNAME(QM1) STATUS(RUNNING)
SUBSTATE(RECEIVE)

Now see who is connected to Reciver channel DISPLAY CHSTATUS(*) ALL . We can see from which address it was connected and Remote queue manager name RQMNAME .

DISPLAY CHSTATUS(*) ALL
     2 : DISPLAY CHSTATUS(*) ALL
AMQ8417I: Display Channel Status details.
   CHANNEL(QM1.TO.QM2)                     CHLTYPE(RCVR)
   BATCHES(0)                              BATCHSZ(50)
   BUFSRCVD(2)                             BUFSSENT(1)
   BYTSRCVD(304)                           BYTSSENT(268)
   CHSTADA(2021-02-03)                     CHSTATI(01.27.43)
   COMPHDR(NONE,NONE)                      COMPMSG(NONE,NONE)
   COMPRATE(0,0)                           COMPTIME(0,0)
   CONNAME(172.31.14.154)                  CURLUWID(0000000000000000)
   CURMSGS(0)                              CURRENT
   CURSEQNO(0)                             EXITTIME(0,0)
   HBINT(300)                              INDOUBT(NO)
   JOBNAME(00000B4700000004)               LOCLADDR(::ffff:172.31.14.154(1415))
   LSTLUWID(0000000000000000)              LSTMSGDA( )
   LSTMSGTI( )                             LSTSEQNO(0)
   MCASTAT(RUNNING)                        MCAUSER(mqm)
   MONCHL(OFF)                             MSGS(0)
   NPMSPEED(FAST)                          RQMNAME(QM1)
   SECPROT(NONE)                           SSLCERTI( )
   SSLCIPH( )                              SSLKEYDA( )
   SSLKEYTI( )                             SSLPEER( )
   SSLRKEYS(0)                             STATUS(RUNNING)
   STOPREQ(NO)                             SUBSTATE(RECEIVE)
   XBATCHSZ(0,0)                           RVERSION(09020001)
   RPRODUCT(MQMM)          

Let’s try to create MQIPTR remote queue on QM1 and MQIPTL local queue on QM2

ON QM2
define ql(MQIPTL)
     4 : define ql(MQIPTL)
AMQ8006I: IBM MQ queue created.

On MQ1

dis chs(*)
     1 : dis chs(*)
AMQ8417I: Display Channel Status details.
   CHANNEL(QM1.TO.QM2)                     CHLTYPE(SDR)
   CONNAME(172.31.14.154(1417))            CURRENT
   RQMNAME(QM2)                            STATUS(RUNNING)
   SUBSTATE(MQGET)                         XMITQ(MQIPTTEST)
define qr(MQIPTR) RNAME(MQIPTL) RQMNAME(QM2) XMITQ(MQIPTTEST)
     2 : define qr(MQIPTR) RNAME(MQIPTL) RQMNAME(QM2) XMITQ(MQIPTTEST)
AMQ8006I: IBM MQ queue created.

Now try to put message on QM1 MQIPTR remote queue and verify on MQIPTL queue on QM2

[mqm@ip-172-31-14-154 errors]$ /opt/mqm/samp/bin/amqsput MQIPTR QM1
Sample AMQSPUT0 start
target queue is MQIPTR
Testing MQIPT
1
2
3
4
5
ENd

Sample AMQSPUT0 end
[mqm@ip-172-31-14-154 errors]$
[mqm@ip-172-31-14-154 errors]$
[mqm@ip-172-31-14-154 errors]$ /opt/mqm/samp/bin/amqsget MQIPTL QM2
Sample AMQSGET0 start
message
message <1>
message <2>
message <3>
message <4>
message <5>
message
no more messages
Sample AMQSGET0 end
[mqm@ip-172-31-14-154 errors]$

That’s it QM1 –> MQIPT –> QM2 . QM1 and QM2 talk to each other with the help of MQIPT without knowing each other .

So far we have seen QMGR to QMGR connectivity through MQIPT [ Standalone mode ] . In the same way we can configure MQIPT for Cluster . Where cluster sender and receiver are connected to MQIPT and then to respective destination server .

Can see some use cases as shown in the below figures .

Related Posts

Leave a Reply

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