Create a QM_APPLE queue manager using WebSphere MQ Explorer/MQSC:-
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_APPLE.
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, as shown in the following screen capture:
Creating the queue manager using MQSC
Open a command prompt, and follow these steps:
1. Create a default queue manager called QM_APPLE by typing the command:
crtmqm -q QM_APPLE
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
A message tells you when the queue manager has started.
3. You must now create a listener by typing the command:
runmqlsr -m QM_APPLE -t TCP -p (port number)
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.
Note: You have now created a queue manager with the name QM_APPLE. The next task is to create a
local queue that this queue manager will manage.
Creating the local queue using WebSphere MQ Explorer
1. In the Navigator view, expand the Queue Managers folder.
2. Expand queue manager QM_APPLE.
3. Right click the Queues folder, then click New > Local Queue... The New Local Queue wizard opens.
4. In the Name field, type QL.APPLE
5. Click Finish.
The new queue, QL.APPLE, is displayed in the Content view, as displayed in the following screen capture:
If the queue is not displayed in the Content view, click the Refresh button at the top of the Content view.
Creating the local queue using MQSC
Open a command prompt and follow these steps:
1. Enable MQSC commands by typing the command:
runmqsc
2. Type the following command:
define qlocal (QL.APPLE)
Messages tell you that the queue has been created and that the default WebSphere MQ objects have been
created.
3. Stop MQSC by typing the command:
End
You have now created a local queue called QL.APPLE. The next task is to put a test message to this newly created
local queue.
Putting a test message on the queue using WebSphere MQ Explorer
1. In the Navigator view, expand the Queue Managers folder.
2. Expand queue manager QM_APPLE, which you created in the previous topic.
3. Click the Queues folder. The queue manager's queues are listed in the Content view.
4. In the Content view, right-click the local queue QL.APPLE, the click Put Test Message... The Put test
message dialog opens.
5. In the Message data field, type some text, for example this is a test message, then click Put message. The
Message data field is cleared and the message is put on the queue.
6. Click Close.
In the Content view, notice that QL.APPLE’s Current queue depth value is now 1, as shown in the following
screen capture:
You might need to scroll to the right to view the Current queue depth column.
Putting a test message on the queue using MQSC
The amqsput sample program is used to put a message on 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 QL.APPLE
o On Windows, type the command: amqsput QL.APPLE
The following messages are displayed:
Sample amqsput0 start
target queue is QL.APPLE
2. Type some message text on one or more lines, then press Enter twice. The following message is
displayed:
Sample amqsput0 end
You have now created a test message and put it onto the local queue. The next task is to verify that the test
message was received.
Verifying that the test message was sent using WebSphere MQ Explorer
1. In the Navigator view, expand the Queue Managers folder, then expand QM_APPLE.
2. Click the Queues folder.
3. In the Content view, right-click QL.APPLE, then click Browse Messages.... The Message browser opens
to show the list of the messages that are currently on QL.APPLE.
4. Double-click the last message to open its properties dialog.
On the Data page of the properties dialog, the Message data field displays the content of the message in humanreadable
form, as shown in the following screen capture:
Verifying that the test message was sent using MQSC
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:
On Windows, type the following command:amqsget QL.APPLE
On Linux, change to the /opt/mqm/samp/bin directory and type the following command:
./amqsget QL.APPLE
The sample program starts, and your message is displayed along with any other messages on this
queue. After 15 seconds, the sample program ends and the command prompt is displayed
No comments:
Post a Comment