+ All Categories
Home > Documents > IBM Introduction to WebSphere Message Queue

IBM Introduction to WebSphere Message Queue

Date post: 07-Nov-2015
Category:
Upload: manoj-prabhakar
View: 229 times
Download: 2 times
Share this document with a friend
Description:
IBM Introduction to WebSphere Message Queue.Steps to Create Local Queue, Remote Queue.
19
Introduction to WebSphere Message Queue: Tutorial 1: Sending a message to a local queue Creating the Queue Manager: Enter Queue manager name, QM_APPLE
Transcript

Introduction to WebSphere Message Queue:

Tutorial 1: Sending a message to a local queue Creating the Queue Manager:

Enter Queue manager name, QM_APPLE

Leave other fields as default values and Click NEXT twice and ensure queue manager startup as Automatic and click NEXT.

Ensure Create listener configuration for TCP/IP box is checked

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 using a different port number, for example: 1415 or 1416. If the default port number of 1414 is not used at this stage, make a note of the port number used because you will need it in later stages of this tutorial when QM_APPLE serves as a receiving queue manager. Click Finish.

Result

Once its been created the Queue manager starts running automatically.Creating the queue manager using MQSCOpen a command prompt, and follow these steps:Procedure1. Create a queue manager called QM_APPLE by typing the command: crtmqm QM_APPLEMessages 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: strmqmA message tells you when the queue manager has started. ResultsYou have now created a queue manager with the name QM_APPLE.

Creating the local queueExpand Queue Manage QM_APPLE and create a new Local Queue

The New Local Queue wizard opens. In the Name field, type Q1 and Click Finish. Result

Local Queue Q1 is displayed in content view.

Creating the local queue using MQSCOpen a command prompt and follow these steps:Procedure1. Enable MQSC commands by typing the command: runmqsc2. Type the following command: define qlocal (Q1)3. Messages tell you that the queue has been created and that the default WebSphere MQ objects have been created.4. Stop MQSC by typing the command: End

ResultsYou have now created a local queue called Q1.

Putting a test message on the local queueIn content view of Local Queue, right-click the local queue Q1, then click Put Test Message.

Type some Message data Sample Test Meessage for Checking Flow of Message Queue, then click Put message. The Message data field is cleared and the message is put on the queue and Click Close.

ResultCurrent queue depth value is 1 now,

Putting a test message on the queue using amqsputThe 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.Procedure1. Start the amqsput sample program as follows: On Linux, change to the MQ_INSTALLATION_PATH/samp/bin directory, where MQ_INSTALLATION_PATH represents the high-level directory in which WebSphere MQ is installed. Type the command: ./amqsput Q1 QM_APPLE On Windows, type the command:amqsput Q1 QM_APPLEThe following messages are displayed: Sample AMQSPUT0 starttarget queue is Q1 1. Type some message text on one or more lines, then press Enter twice. The following message is displayed: Sample AMQSPUT0 endResultsYou have now created a test message and put it onto the local queue. Verifying that the test message was sentIn content view of Local Queue, right-click the local queue Q1, then click Browse Messages.

Message browser opens to show the list of messages that are currently on Q1

Double-click the last message to open its properties dialog.

ResultsOn the Data page of the properties dialog, the Message data field displays the content of the message.

Verifying that the test message was sent using amqsgetOpen a command prompt, and follow these steps:ProcedureStart the amqsget sample program: On Windows, type the following command:amqsget Q1 QM_APPLE On Linux, change to the MQ_INSTALLATION_PATH/samp/bin directory, where MQ_INSTALLATION_PATH represents the high-level directory in which WebSphere MQ is installed. Type the following command: ./amqsget Q1 QM_APPLEResultsThe sample program starts, and your message is displayed along with any other messages on this queue. After a pause of 15 seconds, the sample ends and the command prompt is displayed again.Tutorial 2: Sending a message to a remote queue Creating the queue manager on the sending machineCreate New Queue manager QM_ORANGE using WebSphere MQ Explorer or using command:crtmqm QM_ORANGE

Once the setup completed, you can view the created Queue manager in MQ explorer-Stopped status.

Start this queue manager by typing the command: strmqm QM_ORANGE

You can view the Queue manager up and running in MQ explorer.

When using MQ explorer to create Queue manager for remote queue connection Select Create server-connection channel

Creating the queues on the sending queue managerRight-click the Queues folder under QM_ORANGE, then click New Remote Queue Definition.

The New Remote Queue Definition wizard opens, fill Remote queue infm and click Finish.

Right-click the Queues folder under QM_ORANGE, then click New Local Queue.

Queue name as QM_APPLE and Usage as Transmission. Click Finish and Transmission queue has been created. New queues, Q1 and QM_APPLE, are displayed in the Content view.

Creating a message channelReceiver ChannelOn the receiving queue manager QM_APPLE, create the receiver end of the channel: a. In the Navigator view, expand the queue manager QM_APPLE that we created earlier.b. Right-click the Channels folder, then click New Receiver Channel.

c. The New Receiver Channel wizard opens. In the Name field, type QM_ORANGE.QM_APPLE d. Click Finish. You have now created the receiver channel on the receiving machine.

Sender ChannelOn the sending queue manager QM_ORANGE, create the sender end of the channel: a. In the Navigator view, expand the queue manager QM_ORANGE that we created earlier.b. Right-click the Channels folder, then click New Sender Channel.

c. The New Sender Channel wizard opens. In the Name field, type QM_ORANGE.QM_APPLE, then click NEXT.d. In the Connection name field, type the computer name or IP address of the receiving machine (you should already have obtained this with your system administrator's help). e. If the default port number 1414 was not used when creating QM_APPLE, the Connection name field entry should be of the format: con-name (port)Where con-name is the computer name or IP address of the receiving machine, and port is the port number used when the receiving queue manager was set up.f. In the Transmission queue field, type QM_APPLE and Click Finish.

g. Click the Channels folder. Right-click QM_ORANGE.QM_APPLE. h. From the pop-up menu, click Start. 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).

Putting a test message on QueueThe amqsput sample program is used to put a message onto the queue that you created. Open a command prompt and follow these steps:Procedure1. Start the amqsput sample program as follows: On Linux, change to the /opt/mqm/samp/bin directory and type the command: ./amqsput Q1 QM_ORANGE On Windows, type the command: amqsput Q1 QM_ORANGEThe following messages are displayed: Sample amqsput0 starttarget queue is Q1

2. Type some message text on one or more lines, then press Enter twice. The following message is displayed: Sample amqsput0 end

ResultsYou 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 ExplorerOn the receiving queue manager (QM_APPLE):In the Content view, right-click the queue Q1, then click Browse Messages. The Message browser opens to show the list of the messages that are currently on Q1

. Double click the last message in the list to view its properties dialog.


Recommended