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

Output:

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 :

QMNAME(QMA) STATUS(Running)

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

 

JMS


Message is a method of communication between a software component or application. A messaging client can send a message to other client and can receive a message from other client. Each client connects the Messaging agent to creating, sending , receiving and reading a Message.

The difference between E-mail and Messaging is :
E-mail is communication between people or between software applications and people.
Messaging is used for communication between software applications and software components.

Java Messaging Service is a Java API that allows applications to create, send, receive and read messages.

JMS applications features are:
1)Loosely coupled: A component sends a message to a destination, and the recipient can retrieve the message from the destination. However, the sender and the receiver do not have to be available at the same time in order to communicate. In fact, the sender does not need to know anything about the receiver; nor does the receiver need to know anything about the sender. The sender and the receiver need to know only what message format and what destination to use.
2)Asynchronous: A JMS provider can deliver messages to a client as they arrive; a client does not have to request messages in order to receive them.
3)Reliable: The JMS API can ensure that a message is delivered once and only once. Lower levels of reliability are available for applications that can afford to miss messages or to receive duplicate messages.

You can use the Java API in the fallowing situations:
I)The you want the components not to depend on information about other components’ interfaces, so that components can be easily replaced.
II)The provider wants the application to run whether or not all components are up and running simultaneously.
III)The application business model allows a component to send information to another and to continue to operate without receiving an immediate response.

JMS application is composed of fallowing parts:
1) JMS provider: It is a messaging system that implements JMS interfaces and provides administrative and control features.
2)JMS Clients: These are the programs or components written in Java programing language, that produce and consume messages.
3)Messages: These are the objects that communicate information between JMS clients.
4)Administered objects: These are preconfigured JMS objects created by an administer for the use of clients. The two kinds of Administered objects are destinations and connection factories.
5)Native Clients: these are the programs that use a messaging product’s native client api instead of JMS api.

Fallowing figure illustrate the way these parts interacts:

JMS provides the two types of domain applications
1)Point- to- Point Messaging domain.
2)Publish/Subscribe Messaging domain.

1)Point-to-point Messaging domain:
PTP messaging have fallowing characteristics
→ Each message has only one consumer.
→ A sender and receiver of a message have no timing dependencies. The receiver can fetch the message whether or not it was running when the client sends the message.
→ The receiver acknowledges the successful processing of message.
Use PTP when every message you send must be processed successfully by one consumer.

2)Publish/Subscribe Messaging domain:
pub/sub messaging have fallowing characteristics.
→ Each message may have multiple consumers
→ Publishers and subscribers have a timing dependency. A client that subscribes to a topic can consume only messages published after the client has created a subscription, and the subscriber must continue to be active in order for it to consume messages.

The basic building blocks of a JMS application consist of
Administered objects:Connection factories and destinations Connections
Sessions
Message producers
Message consumers
Messages

These building blocks explained one by one as fallows.

1)Administered Objects: