Create a point to point or Distribution MQ Setup:
A communication between two queue managers to send or receive the data is called distribution queuing or point to point setup.
QM1 QM2
1.
QUEUE MANAGER 1.QUEUE MANAGER
2. LOCAL QUEUE 2. LOCAL QUEUE
3.QUEUE
REMOTE 3. REMOTE QUEUE
4.TRANSMISSION
QUEUE 4.TRANSMISSION QUEUE
5. SENDER
CHANNEL 5. SENDER CHANNEL
6.LISTENER 6. LISTENER
7.RECEIVER CHANNEL 7.RECEIVER CHANNEL
THEN START THE CHANNEL
OPEN THE
COMMAND PROMPT 'RUN AS ADMINISTRATOR'.
1.Create Queuemanager as 'QM1'
CRTMQM QM1
Start the Queue manager
STRMQM QM1
Enter into the Queue manager
RUNMQSC QM1
DEFINE QLOCAL(LQ1)
3. Create Remote Queue
DEFINE
QREMOTE(RQ1)
RNAME(LQ2)
RQMNAME(QM2)
XMITQ(QM1.XMITQ)
4 Create Transmission Queue.
DEFINE
QLOCAL(QM1.XMITQ) USAGE(XMITQ)
5.Create sender channel
DEFINE CHANNEL(QM1.QM2) CHLTYPE(SDR)
CONNAME('LOCALHOST(2012)') XMITQ(QM1.XMITQ)
6.Create receiver channel
DEFINE CHANNEL(QM2.QM1) CHLTYPE(RCVR)
DEFINE CHANNEL(QM2.QM1) CHLTYPE(RCVR)
7.Create Listener
DEFINE LISTENER (L1) TRPTYPE(tcp) PORT
(2011)
EXIT FROM QM1: > END
QM2 CREATION:
1.Create Queuemanager as 'QM2'
CRTMQM QM2
Start the Queue manager
Start the Queue manager
STRMQM QM2
Enter into the Queue manager
RUNMQSC QM2
2.Create Local queue
DEFINE QLOCAL(LQ2)
3. Create Remote Queue
DEFINE
QREMOTE(RQ2)
RNAME(LQ1)
RQMNAME(QM1)
XMITQ(QM2.XMITQ)
4 Create Transmission Queue.
DEFINE
QLOCAL(QM2.XMITQ) USAGE(XMITQ)
5.Create sender channel
DEFINE CHANNEL(QM2.QM1) CHLTYPE(SDR)
CONNAME('LOCALHOST(2011)') XMITQ(QM2.XMITQ)
6.Create receiver channel
DEFINE CHANNEL(QM1.QM2) CHLTYPE(RCVR)
DEFINE CHANNEL(QM1.QM2) CHLTYPE(RCVR)
7.Create Listener
DEFINE LISTENER (L2) TRPTYPE(tcp) PORT
(2012)
- START THE LISTENER
START LISTENER(L2)
- START THE CHANNELS
START CHANNEL(QM1.QM2)
START CHANNEL(QM2.QM1)
- EXIT FROM QM2
END
Enter into QM1 and Start the Listener and channels
Start Channels: START CHANNEL(QM1.QM2)
START CHANNEL(QM2.QM1)
start listener: START LISTENER(L1)
Here i will give some commands.
channel status: DISPLAY CHS(CHANNEL NAME)
DISPLAY CHS(QM1.QM2)
To change or alter any attribute for mq objects:
DEFINE CHANNEL(QM1.QM2) CHLTYPE(SDR)
CONNAME('HOST(2012)') XMITQ(QM1.XMITQ)
HERE I WANT TO CHANGE CONNAME 'HOST' TO 'LOCAL HOST'
ALTER CHANNEL(QM1.QM2) CHLTYPE(SDR)
CONNAME('LOCALHOST(2012)') XMITQ(QM1.XMITQ)
Now the setup is completed. We will test the setup by sending messages.
- TO PUT A MESSAGE WE CAN USE BELLOW COMMAND:
AMQSPUT <DESTINATION LOCALQUEUE> <DESTINATION QUEUE MANAGER>
AMQSPUT LQ2 QM2
- To get a message we can use bellow command.
AMQSGET <LOCALQUEUE NAME> <QUEUE MANAGER NAME>
AMQSGET LQ2 QM2
No comments:
Post a Comment