Create QM_ORANGE queue manager using WebSphere MQ Explorer/MQSC
On another machine/remote queue manager:
1. Start WebSphere MQ Explorer.
2. In the Navigator view, right-click the Queue Managers folder, then click New > Queue Manager The
Create Queue Manager wizard opens.
3. In the Queue Manager Name field, type QM_ORANGE.
4. Select the Make this as a default queue manager check box.
5. Click next twice to go to Step 3 of the wizard.
6. Ensure that the Start queue manager check box is selected.
7. Ensure that the Auto start queue manager check box is selected.
8. Click next to go to Step 4 of the wizard.
9. Ensure that the Create listener configured for TCP/IP check box is selected
10. If the Finish button is not available, type another port number in the Listen on port number field. If
the current value is 1414, try typing 1415 or 1416.
11. Click Finish.
An icon representing this queue manager is displayed in the Queue Managers folder in the Navigator view of
WebSphere MQ Explorer, and the queue manager automatically starts running after you create it.
Creating the sending queue manager using MQSC
Open a command prompt on the sending machine and follow these steps:
1. Create a default queue manager called QM_ORANGE by typing the command:
crtmqm -q QM_ORANGE
Messages tell you that the queue has been created and that the default WebSphere MQ objects have
been created.
2. Start this queue manager by typing the command:
strmqm QM_ORANGE
A message tells you when the queue manager has started.
3. You must now create a listener by typing the command:
runmqlsr -m QM_ORANGE -t TCP -p(port number)
Note: If you do not specify anything with the -p parameter, the default port 1414 is used, but note that
you cannot use the same port number on the sender and receiver, so one could be 1414 and the other
1415 for example.
You have now created the sending queue manager. The next task is to create the queues on this queue
manager.
Creating the queues on a queue manager using WebSphere MQ Explorer
On the remote queue manager:
1. In the Navigator view, expand the Queue Managers folder.
2. Expand queue manager QM_ORANGE.
3. Right click the Queues folder, then click New > Remote Queue Definition... The New Remote Queue
Definition wizard opens.
4. In the Name field, type QR.ORANGE
5. In the Remote queue field, type QM.APPLE.
6. In the Remote queue manager field, type QM_APPLE.
7. Ensure that the Transmission queue field is left blank.
8. Click Finish. You have now created the remote queue definition.
9. Click the QM_ORANGE queue manager.
10. Right-click the Queues folder, then click New > Local Queue The New Local Queue wizard opens.
11. In the Name field, type QMTX_APPLE.
12. In the Usage field, select Transmission.
13. Click Finish. You have now created the transmission queue on the local machine.
QR.ORANGE and Q.APPLE are displayed in the content view of the respective queue manager.
If the queues are not displayed in the Content view, click the Refresh button at the top of the Content view.
Creating the queues on the sending queue manager using MQSC
Open a command prompt on the sending machine and follow these steps:
1. Start MQSC by typing the command:
runmqsc QM_ORANGE
A message tells you that an MQSC session has started.
2. Define a transmission queue called QM_APPLE by typing the following command:
define qlocal(QMTX_APPLE) usage(xmitq)
A message tells you when the queue has been created.
3. Define a remote queue definition by typing the following command:
define qremote(QR.ORANGE) rname(QM.APPLE) rqmname(QM_APPLE) xmitq
(QMTX_APPLE)
You have now created the queues on the sending queue manager. The next task is to create the message
channel between the sending and receiving queue managers.
Creating the message channel using MQ Explorer
On the receiving/local queue manager, QM_APPLE:
1. In the Navigator view expand the queue manager QM_APPLE that you created earlier, then expand the
Advanced folder.
2. Right-click the Channels folder, then click New > Receiver Channel... The New Receiver Channel
wizard opens.
3. In the Name field, type QM_ORANGE.QM_APPLE.
4. Click Finish. You have now created the receiver channel on the receiving machine.
On the sending queue manager, QM_ORANGE:
5. Expand the queue manager QM_ORANGE that you created earlier, then expand the Advanced folder.
6. Right-click the Channels folder, then click New > Sender Channel... The New Sender Channel wizard
opens.
7. In the Name field, type QM_ORANGE.QM_APPLE, and then click next.
8. In the Connection name field, type the computer name or IP address & Port of the receiving
(QM_APPLE) machine (you should already have obtained this with your system administrator's help).
examples - conname = x.x.x.x(PORT)
9. In the Transmission queue field, type QM_APPLE.
10. Click Finish.
11. Click the Channels folder.
12. Right-click QM_ORANGE.QM_APPLE.
13. From the pop-up menu, click Start.
14. Click OK. You have now created the sender channel on the sending machine.
Note: You do not have to start the receiver channel, because it started automatically when you set up
the sender channel (when you set up the sender channel, you specified the receiver channel's IP
address).
You have now created a receiver channel, QM_ORANGE.QM_APPLE, on the receiving queue manager,
QM_APPLE, and a sender channel, QM_APPLE.QM_ORANGE, on the sending queue manager,
QM_ORANGE. You have also started the sender channel, which automatically started the receiver channel
too.
Creating the message channel using MQSC
Open a command prompt on the receiving machine and follow these steps:
1. Start MQSC by typing the command:
runmqsc QM_APPLE
A message tells you that an MQSC session has started.
2. Define a receiving channel by typing the following command:
define channel(QM_ORANGE.QM_APPLE) chltype(RCVR) trptype(TCP)
A message tells you when the channel has been created.
3. Stop MQSC by typing:
end
Some messages are displayed followed by the command prompt.
Open a command prompt on the sending machine and follow these steps:
4. Start MQSC by typing the command:
runmqsc QM_ORANGE
A message tells you that an MQSC session has started.
5. Define a sender channel by typing the following command:
define channel(QM_ORANGE.QM_APPLE) chltype(sdr) conname('I/P(port)')
xmitq(QM_APPLE) trptype(tcp)
The value con-name is the TCP address of the receiver queue manager.
6. Start the channel by typing the following command:
start channel(QM_ORANGE.QM_APPLE)
7. Stop MQSC by typing:
End
Some messages are displayed followed by the command prompt.
You have now created all the WebSphere MQ objects required for messages to be sent from the sending
queue manager QM_ORANGE to the queue QR.ORANGE on the receiving queue manager QM_APPLE. The
next task is to send a test message.
Putting a test message onto the queue using MQSC
Perform this task on the sending machine (the machine that hosts the queue manager QM_ORANGE.
The amqsput sample program is used to put a message onto the queue that you created.
On Windows the sample programs are installed by default with WebSphere MQ Server or Client. On Linux, the
samples programs RPM need to be installed.
Open a command prompt and follow these steps:
1. Start the amqsput sample program as follows:
o On Linux, change to the /opt/mqm/samp/bin directory and type the command:
./amqsput QR.ORANGE QM_ORANGE
o On Windows, type the command: amqsput QR.ORANGE QM_ORANGE
The following messages are displayed:
Sample amqsput0 start
target queue is QR.ORANGE
2. Type some message text on one or more lines, and then press Enter twice. The following message is
displayed:
Sample amqsput0 end
You have now created a test message and put it onto the remote queue. The next task is to verify that the test
message was received.
Verifying that the test message was sent using WebSphere MQ Explorer
Perform this task on the receiving machine (the machine that hosts the queue manager QM_APPLE).
On the receiving queue manager:
1. In the Navigator view, expand queue manager QM_APPLE.
2. Click the Queues folder.
3. In the Content view, right-click the queue QR.ORANGE, then click Browse Messages... The Message
browser opens to show the list of the messages that are currently on QM.APPLE.
4. Double click the last message in the list to view its properties dialog.
On the Data page of the properties dialog, the Message data field displays the content of the message in
human-readable form.
Verifying that the test message was sent using MQSC
You perform this task on the receiving machine (the machine that hosts the queue manager QM_APPLE). The
amqsget sample program is used to get the message back from the queue.
Open a command prompt and follow these steps:
Start the amqsget sample program as follows:
On Linux, change to the /opt/mqm/samp/bin directory and type the command:
./amqsget QM.APPLE QM_APPLE
On Windows, type the command: amqsget QM.APPLE QM_APPLE
The sample program starts, and your message is displayed along with any other messages on this queue. After
a short pause, the sample program ends and the command prompt is displayed again.
END
No comments:
Post a Comment