Sei sulla pagina 1di 9

LAB 1:

Points to keep in mind:


Please be patient about topics to be practiced. We are mulling every possible
aspect of troubleshooting techniques in WMQ. Those will be covered step by step.
We have provided combination of both control command & runmqsc commands
to achieve the given topics.
These command reference is similar on almost all platforms (windows & UNIX
flavors & Iseries)
A command can be used in many possible ways as it refers to different flags.
Here we are covering most of them under different tasks.
Any doubts on the topics, voice them with your instructor.
WMQ Tasks:
1. Display version of MQ installed.
2. Display what all queue manager running on a machine
3. App1-QM-App2 message flow
4. App1-QM1-QM3-App2 message flow

Display version of MQ installed:


Dspmqver this will show the version of MQ installed on a system.

Look at the version row, it shows MQ version in the form V.R.M.F


Where V=Version, R=Release, M=Modification and F=Fix pack

Check readme file available in c:\Program Files\IBM\WebSphere MQ\PTF (this is


default folder of installation if installation path changed check accordingly) open the file
with suitable text editor. It contains the service level and maintenance applied.

Display Queue managers running on a machine:


Dspmq has different flags to show different attributes of queue manager. One can check
the dspmq flag details by typing dspmq ?

It shows all the queue manager status by default, whether they are running or not.

To see individual queue manager status one can use m flag as below

App1-QM-App2 message flow:


Assume I am going to create QMTEST queue manager and QMTEST.TESTMSG
named local queue for this purpose.
Amqsput - for placing non persistent messages on any queue
Amqsbcg for browsing message from a queue
Amqsget for getting a message from q queue
These are sample programs supplied by IBM with product, there default location is
C:\Program Files\IBM\WebSphere MQ\bin in windows
/opt/mqm/samp/bin in unix flavors(linux, sun solaris etc)
/usr/mqm/samp/bin in AIX

Creation of a new queue manager:


Crtmqm is used to create a queue manager. It has lot of optional flags we will discuss
about them as & when required in our tasks.

Crtmqm QMTEST

Dspmq QMTEST

Starting Queue manager QMTEST


Strmqm QMTEST, this will bring the queue manager to running status.

Entering runmqsc mode


For working with MQ objects like (queue manager, queues , processes,
channels, listeners) we need to enter into runmqsc mode.
Type runmqsc QMTEST
Define command is used to create any object. To create a local queue
Define qlocal(qname)
For the above all the qlocal attributes are taken by default from
SYSTEM.DEFAULT.LOCAL.QUEUE. This queue is created when a queue manager is
created.

Placing a message in local queue.


amqsput <qname> <qmgrname>
MQ objects are case sensitive; make sure they are given correctly. Bellow 2 messages
are placed in the queue.

Checking whether messages reached the queue or not. This we can confirm by
checking the curdepth attribute of the local queue.
Curdepth how many messages are available in the queue at that point of time. Check
the queue attributes in below screen shot in alphabetical order.
A non zero value shows number of messages available.

Display qlocal(qname) --- this shows all queue attributes

Display qlocal(qname) curdepth --- shows only curdepth value of that particular queue.

Display qlocal(qname) curdepth maxdepth --- shows current number of messages as well
as maximum number of messages this queue can store.

This is an example for checking multiple attributes at one time.

Browsing the messages from queue:


Amqsbcg qname qmgrname
It will browse the message but wont delete from queue. Means, you can browse
message any number of times.

Taking messages from qlocal:


Amqsget qname qmgrname
It will get the messages from the queue. After this check the curdepth value, it will be 0.

This way amqsput application/program used to place message on queue and amqsget
application/program consumed the message.

APP1-QM1-QM2-APP2:
Send a message from QM1 to QMTEST queue manager.
Objects needed on QM1 (source) end:
Remote queue definition QM1.TESTMSG
Transmission queue definition QMTEST
Sender channel definition QM1.QMTEST
Objects needed on QMTEST (destination) end:
Take the local queue created, QMTEST.TESTMSG
Receiver channel definition QM1.QMTEST
Listener definition QM1.LSTR.12345
QM1 end:
Need a remote queue definition, which holds the details of destination queue and queue
manager.
Define qremote(name) rname(remoteqname) rqmname(remoteqmname)
xmitq(corresponding xmitq)

Create a xmitq(transmission queue) to hold the message from remote queue


temporarily. Its a local queue with usage as xmitq.

As QM1 is sending end, we need to create a sender channel definition in this queue
manager.
To talk about conname, it holds the destination queue manager host ipaddress or DNS
name & port number.

Channel status is not yet started so it is in not found.

QMTEST End:
Local queue is already created.

Create a listener on that particular port at which sender channel is going to send
messages.

After creation of listener, its status is not found until started.

Starting the listener

Now check the listener status, it should be in running state.

Create a receiver channel definition for the corresponding sender channel one.

All the required objects are created on both queue managers. Now start the sender
channel in QM1.

After command, check the channel status.

Now setup is ready for transferring messages.


Placing messages on remote queue of QM1

Check the number of message available in local queue of QMTEST.

Get the messages from local queue on QMTEST.

Potrebbero piacerti anche