My Understanding of MQSeries

来源:互联网 发布:jdbc示例数据库 编辑:程序博客网 时间:2024/05/15 21:39

WebSphere MQ is a means of program-to-program communication using messages and queues. The communicating applications can be on the same system, or they can be distributed across a network in different platforms.

It has following advantages:

1-      Common application programming interface
MQS provides Message Queue Interface(MQI) that is consistent across all the supported platforms. Programmers can invoke the same functions to communicate with MQS to put or get messages even in different platforms.

2-      Assured message delivery
MQS can transfer data with assured delivery, i.e. the messages don’t get lost, even in the event of a system failure; and the messages are derived once and only once.

3-      Time-independent processing
The communicating applications don’t have to be active at the same time. There are two kinds of message delivering mechanisms. One is synchronous communication and the other is asynchronous communication. So, a sending application can still be putting messages on a queue even though the receiving application is not active.

4-      Application parallelism
Message-driven processing is a style of application design. An application is divided into discrete functional modules which communicate with each other by means of messages. In this way, the modules can execute on different systems, be scheduled at different times, or they can act in parallel.

5-      Faster application development
Because MQS shields the complexities of the network programming, application development is made faster.

In the MQS, there are some objects such as message, queue, queue manager, channel, distribution list and so forth.

1-      Message is a unit of information transmitted from one program to another, which consists of persistent and non-persistent message

2-      Queue is a place to store the messages, there are many types of queues including local queue, remote queue, transmission queue, dead-letter queue, reply-to queue and so forth.

3-      Queue manager owns and manages queues.

4-      Channel is a logical communication link, includes two different kinds of channels: Message channels which connects two queue managers via Message Channel Agents; and MQI channel which connects a MQSeries client to a queue manager in its server machine.

5-      Distribution list contains a list of queue names and the queue managers that own them.

Normally when we use the MQS, we can use the MQSC to create and maintain the Queue Managers.

1-      Using CRTMQM to create a QM and DLTMQM to delete it.

2-      Using STRMQM to start a QM and ENDMQM to stop it.

3-      Using DEFINE to define a (local, remote…) queue

4-      Using ALTER to alter the attributes of the MQS objects

5-      Using DISPLAY to display the attributes of the MQS objects

6-      Using AMQSPUT/AMQSGET/AMQSBCG to put/get/browse the messages in the specified queue