Basic MQ Commands

1. Create/start/stop a Queue Manager

crtmqm [-z] [-q] [-c Text] [-d DefXmitQ] [-h MaxHandles]
[-g ApplicationGroup] [-t TrigInt]
[-u DeadQ] [-x MaxUMsgs] [-lp LogPri] [-ls LogSec]
[-lc | -ll] [-lf LogFileSize] [-ld LogPath] QMgrName

Output :

WebSphere MQ queue manager created.
Creating or replacing default objects for QMA.
Default objects statistics : 43 created. 0 replaced. 0 failed.
Completing setup.
Setup completed.

2. Starting a Queue Manager

$ strmqm QMA


WebSphere MQ queue manager ‘QMA’ starting.
2108 log records accessed on queue manager ‘QMA’ during the log
replay phase.
Log replay for queue manager ‘QMA’ complete.
Transaction manager state recovered for queue manager ‘QMA’.
WebSphere MQ queue manager ‘QMA’ started.

3. Checking that the Queue Manager is running

$ dspmq

Output :


4. Stopping a Queue Manager

$ endmqm –i QMA

5. Deleting a Queue Manager

The following command will stop all the Listeners associated with Queue Manager pointed to by the –m flag (QMA in this example). The –w flag means the command will wait until all the Listeners are stopped before returning control:

$ endmqlsr -w -m QMA

The command to stop (end) the Queue Manager is:

$ endmqm QMA

And fnally the command to delete the Queue Manager is:

$ dltmqm QMA


Other Useful Links:

Enable JMX Remote port in WebSphere