566 WebSphere Information Integrator Q Replication: Fast Track Implementation Scenarios
# Manager are stopped and deleted before attempting to recreate
# them in the secions below.
#
# Uncomment the following lines if you wish to run this script
# to recreate all objects, after an initial run
#endmqm QM_PEER2
#sleep 30
#endmqlsr
#sleep 20
#dltmqm QM_PEER2
#################################################################
# 1) Create Queue Manager on PEER2 (do not make it the default QM)
#################################################################
##Queue Manager reference B.11
crtmqm QM_PEER2
#################################################################
# 2) Start the Queue Manager on PEER2
#################################################################
##Queue Manager reference B.11
strmqm QM_PEER2
#################################################################
# 3) Start a WebSphere MQ listener
#################################################################
##WebSphere MQ listener port reference B.12
runmqlsr -m QM_PEER2 -t tcp -p 1420 &
#################################################################
# 4) Create the queue/channel objects
#################################################################
##Local AdminQ reference B.17
##Local AdminQ MAXMSGL reference B.17a
##Local AdminQ MAXDEPTH reference B.17b
runmqsc QM_PEER2 <<!
DEFINE QLOCAL(PEER2_ADMINQ) +
REPLACE +
DESCR('LOCAL DEFN OF ADMINQ FOR PEER2 CAPTURE') +
PUT(ENABLED) +
GET(ENABLED) +
DEFPSIST(YES) +
MAXMSGL(4194403) +
MAXDEPTH(5000)
##
##Local RestartQ reference B.16
Chapter 6. Peer-to-peer Q replication on AIX platforms 567
##Local RestartQ MAXMSGL reference B.16a
##Local RestartQ MAXDEPTH reference B.16b
DEFINE QLOCAL(PEER2_RESTARTQ) +
REPLACE +
DESCR('LOCAL DEFN OF RESTARTQ FOR PEER2 CAPTURE') +
PUT(ENABLED) +
GET(ENABLED) +
DEFPSIST(YES) +
MAXMSGL(4194403) +
MAXDEPTH(5000)
##
##Local SpillQ reference B.20
##Local SpillQ MAXMSGL reference B.20a
##Local SpillQ MAXDEPTH reference B.20b
DEFINE QMODEL(IBMQREP.SPILL.MODELQ) +
REPLACE +
DEFSOPT(SHARED) +
MAXDEPTH(500000) +
MSGDLVSQ(FIFO) +
DEFTYPE(PERMDYN) +
MAXMSGL(100000)
##
##Remote SendQ QREMOTE reference B.18
##Remote SendQ XMITQ reference B.18a
##Remote SendQ RNAME reference B.18b
##Remote SendQ RQMNAME reference B.18c
DEFINE QREMOTE(PEER2_TO_PEER1_Q) +
REPLACE +
DESCR('REMOTE DEFN OF SEND QUEUE FROM PEER2 TO PEER1') +
PUT(ENABLED) +
XMITQ(QM_PEER1) +
RNAME(PEER2_TO_PEER1_Q) +
RQMNAME(QM_PEER1) +
DEFPSIST(YES)
##
##Local ReceiveQ QLOCAL reference B.19
##Local ReceiveQ MAXMSGL reference B.19a
##Local ReceiveQ MAXDEPTH reference B.19b
DEFINE QLOCAL(PEER1_TO_PEER2_Q) +
REPLACE +
DESCR('LOCAL RECEIVE QUEUE FOR PEER2 FROM PEER1') +
GET(ENABLED) +
SHARE +
DEFPSIST(YES) +
MSGDLVSQ(PRIORITY) +
568 WebSphere Information Integrator Q Replication: Fast Track Implementation Scenarios
MAXMSGL(4194403) +
MAXDEPTH(5000)
##
##Remote AdminQ QREMOTE reference B.21
##Remote AdminQ XMITQ reference B.21a
##Remote AdminQ RNAME reference B.21b
##Remote AdminQ RQMNAME reference B.21c
DEFINE QREMOTE(PEER1_ADMINQ) +
REPLACE +
DESCR('REMOTE DEFN OF ADMINQ FOR PEER1 CAPTURE') +
PUT(ENABLED) +
XMITQ(QM_PEER1) +
RNAME(PEER1_ADMINQ) +
RQMNAME(QM_PEER1) +
DEFPSIST(YES)
##
##Local TransmitQ QLOCAL reference B.13
##Local TransmitQ TRIGDATA reference B.13a
##Local TransmitQ INITQ reference B.13b
##Local TransmitQ MAXMSGL reference B.13c
##Local TransmitQ MAXDEPTH reference B.13d
DEFINE QLOCAL(QM_PEER1) +
REPLACE +
DESCR('TRANSMISSION QUEUE TO PEER1') +
USAGE(XMITQ) +
DEFPSIST(YES) +
TRIGGER +
TRIGTYPE(FIRST) +
TRIGDATA(PEER2_TO_PEER1) +
INITQ(SYSTEM.CHANNEL.INITQ) +
MAXMSGL(4194403) +
MAXDEPTH(5000)
##
##Local SDR channel CHANNEL reference B.14
##Local SDR channel TRPTYPE reference B.14a
##Local SDR channel XMITQ reference B.14b
##Local SDR channel CONNAME reference B.14c
##Local SDR channel HBINT reference B.14d
DEFINE CHANNEL(PEER2_TO_PEER1) +
CHLTYPE(SDR) +
REPLACE +
TRPTYPE(TCP) +
DESCR('SENDER CHANNEL TO PEER1') +
XMITQ(QM_PEER1) +
CONNAME('9.1.39.79(1421)') +
HBINT(300) +
Chapter 6. Peer-to-peer Q replication on AIX platforms 569
DISCINT(0)
##
##Local RCV channel CHANNEL reference B.15
##Local RCV channel TRPTYPE reference B.15a
##Local RCV channel HBINT reference B.15b
DEFINE CHANNEL(PEER1_TO_PEER2) +
CHLTYPE(RCVR) +
REPLACE +
TRPTYPE(TCP) +
DESCR('RECEIVER CHANNEL FROM PEER1') +
HBINT(300)
##
##MAXUMSGS reference B.11b
##MAXMSGL reference B.11c
ALTER QMGR +
MAXUMSGS(10000) +
MAXMSGL(4194403)
!
# END OF SCRIPT
Verify successful WebSphere MQ configuration
After performing the initial configuration, the channels must be started on each
Queue Manager, and then messages may be inserted and retrieved from local
and remote queues to verify successful configuration.
Example 6-17 and Example 6-18 show scripts that start the sender channel on
node PEER1 and PEER2, respectively.
Example 6-17 Start the sender channel on PEER1
#################################################################
# Run on PEER1
#################################################################
#
# Start the sender channel
#
runmqchl -c PEER1_TO_PEER2 -m QM_PEER1 &
Example 6-18 Start the sender channel on PEER2
Note: The same listener port can be used on both host servers, but it may be
easier to debug if one uses a different port on each.
570 WebSphere Information Integrator Q Replication: Fast Track Implementation Scenarios
#################################################################
# Run on PEER2
#################################################################
#
# Start the sender channel
#
runmqchl -c PEER2_TO_PEER1 -m QM_PEER2 &
After the channels have been started, some of the several queue pairs may be
tested to ensure that communications are working properly. We tested local as
well as remote queues, as follows.
Testing local queues
Example 6-19 lists a local queue on the PEER1 and PEER2 nodes.
Example 6-19 Local queues
####################################################
Simple Queues: amqsput/amqsget
####################################################
PEER2_RESTARTQ QM_PEER2
PEER1_RESTARTQ QM_PEER1
For each of these queues, we inserted a message (using
/usr/mqm/samp/bin/amqsput) and read back the message (using
/usr/mqm/samp/bin/amqsget) on the same node, as shown in Example 6-20.
Testing local queues ensures that they are set up properly, but does not test the
connectivity between the queue managers—for that we need to test the remote
queues.
Example 6-20 Test put and get from a local queue
####################################################
# Execute the following command to put a message into the queue
####################################################
/usr/mqm/samp/bin/amqsput PEER2_RESTARTQ QM_PEER2
Sample AMQSPUT0 start
target queue is PEER2_RESTARTQ
This is a test message to a local queue
Sample AMQSPUT0 end
#
####################################################
# Execute the following command to get the message from the queue.
# The program should display the text one entered above then pause
# for a few seconds waiting for more messages.
####################################################

Get WebSphere Information Integrator Q Replication: Fast Track Implementation Scenarios now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.