Call Me at +91 7798846928 for Trainings

My photo
I am a Middleware Trainer and Consultant for Websphere (WAS, MQ), Weblogic, SOA and JBOSS Administration. Drop a mail to kvn@live.in for trainings and videos or call on +91 7798846928 for details.

Thursday, February 13, 2014

Websphere MQ Basics/Fundamentals

IBM WMQ ensures once and only once assured delivery of messages from one business application to another business application.

Pre-defined MQ Objects are 7:
1 Queue Manager
2 Queue
3 Channel
4 Listener
5 Process
6 NameList
7 Service

Queue Manager is initial and foremost object. Unless QM object is defined the other objects cant be created.
The remaining 6 objects can/will be defined in Queue Manager control. Therefore Queue Manager is a sub-system which can control MQ objects.
Queue Manager is SPOC for connecting Business Apps to perform PUT/GET operations on Queue objects.

CRTMQM: is a control command to create a queue manager.
Template: C:\> CRTMQM <QMNAME>
Example: CRTMQM BOCQM1

In production like environment we limit the Queue Manager name to 8 uppercase characters. 8 char is the limit for QM object name.
Name of the MQ server is <QMNAME>

DSPMQ: is a control command to track the current status of QM.
Template: C:\> DSPMQ -M <QMNAME>
Example: DSPMQ -M BOCQM1
Default status of QM is 'ended immediately'.


How to create other MQ objects once QM is defined/created?
QM service should be running.

STRMQM: is a control command to start the QM.
Template: C:\> STRMQM <QMNAME>
Example: STRMQM BOCQM1

DSPMQ: is a contol command which will display QM name and status properties.
Now check the status of QM!
Example: DSPMQ -M BOCQM1
Status of BOCQM1 Queue manager is changed to 'Running'

ENDMQM: is a control command which will be used to stop QM.
Template: ENDMQM -I <QMNAME>, ENDMQM <QMNAME>
Example: ENDMQM -I VANQM1, ENDMQM VANQM1

How to create other MQ objects once QM is defined/created and is running?
RUNMQSC: is a control command To switch/interfacewith QM and define other MQ objects. Once we execute this command, MQSC for QM will be enabled.
All 14 MQSC commands are constant.

Valid MQSC commands are:
1 ALTER
2 CLEAR
3 DEFINE
4 DELETE
5 DISPLAY
6 END
7 PING
8 REFRESH
9 RESET
10 RESOLVE
11 RESUME
12 START
13 STOP
14 SUSPEND

The above MQSC commands will be used for administering the MQ objects defined under QM.
END is an MQSC command which is used to quit the RUNMQSC console(QM control area/WMQ System Admin MQ access).

In IBM WMQ, queues are classified in 2 categories:
1 Pre-defined Q's
2 Dynamic Q's

Pre-defined Q's are 4 in count:
1 Local Q >> Holds business data/messages, therefore its also called business Q.
2 Alias Q
3 Remote Q
4 Model Q >> is a template to create Dynamic Q using model Q object definition and is done in run-time.

Dynamic Q's are 2 in number:
1 Temporary Dynamic Q
2 Permanent Dynamic Q

There are 4 special local Queues(which are not business queues) :
1 Transmission Q
2 Initiation Q
3 Dead Letter Q
4 System Q

GOTCHAS >> If "TYPE(QLOCAL) USAGE(NORMAL)" then such a queue is a business queue. If USAGE(XMITQ) is used instead, then it will become transmission queue.


DEFINE: is a RUNMQSC command used to create pre-defined objects other than QM.
Channel names are limited to 20 characters in length.
Other object names can be upto 48 characters.
Example: DEFINE QLOCAL(QNAME)

DISPLAY: is a RUNMQSC command which is used to display properties of MQ objects other than QM.
Example: DISPLAY QSTATUS(QNAME) TYPE(HANDLE)

ALTER: is a RUNMQSC command used to change the behaviour/property values of objects other than QM.
Example: ALTER QLOCAL(QNAME) PUT(DISABLED) GET(ENABLED)

MAXMSGL: is a Q property which indicates the maximum length of a message that it can hold.
Example: DISPLAY QLOCAL(QNAME) MAXMSGL, ALTER QLOCAL(QNAME) MAXMSGL(40).
By default the maxmsgl property of a q can hold a message of lenth 4 MB each. Remember that it shows maxmessagelength value in bytes.
The maximum message length allowed in MQ is 100MB. Default is 4MB.

gotcha >> TASKKILL /F /PID PROCESSID
Example: TASKKILL /F /PID 3442

DELETE: is a RUNMQSC command used to delete the MQ objects other than QM.
Example: DELETE QLOCAL(TESTQ)

No comments:

Post a Comment