Transferred from: http://hi.baidu.com/lubezhang/blog/item/bd308b3b7ecce3ec14cecb4f.html
IBM MQ (IBM message Queue) is IBM's commercial messaging intermediary product for distributed computing environments or heterogeneous systems. Message Queuing technology is a technique for exchanging information among distributed applications. Message Queuing can reside in memory or on disk, and queues store messages until they are read by the application. With Message Queuing, applications can execute independently-they do not need to know each other's location, or wait for the receiving program to receive this message before proceeding.
MQ Basic Concepts
1. To the Column Manager
The queue Manager is the topmost concept in the MQ system, which provides us with a queue-based messaging service.
2. Message
In MQ, we define our application as a message in the data that MQ transmits, we can define the content of the message and understand the message in a broad sense, such as: The user's various types of data files, an application to other applications issued processing requests, etc. can be used as messages. The message consists of two parts: a message descriptor (MSG discription or message Header) that describes the characteristics of the message, such as the priority of the message, the life cycle, the message ID, and so on; the body of the message, the part of the user data. In MQ, messages are classified into two types, non-persistent (non-persistent) messages and persistent (persistent) messages, non-persistent messages stored in memory, designed to improve performance, and unrecoverable when the system is out of power or the MQ Queue Manager restarts. When the user's reliability requirements for the message are not high, but focus on the performance of the system, you can use this type of message, such as: When the stock information is published, because the stock information is constantly updated, we may be published every few seconds, new messages will continue to overwrite the old message. The permanent message is stored on the hard disk, and records the data log, it is high reliability, in the network and system failure, etc. can ensure that the message is not lost, not heavy.
In addition, in MQ, there is the concept of logical messages and physical messages. With logical messages and physical messages, we can segment large messages, or we can classify several of their own complete messages into a group of application logic.
3, to the column
A queue is a secure place to store messages, and the queue stores messages until it is processed by the application.
Message Queuing works in the following ways:
A) program a forms a call to the Message Queuing system, which informs the Message Queuing system that the message is ready to go to program B;
b) The Message Queuing system sends this message to the system where program B resides and places it in the queue of program B;
c) After the appropriate time, program B reads this message from its queue and processes this information.
Because of the Advanced program design idea and the internal working mechanism, MQ can guarantee the reliable transmission of the message under various network conditions, and can overcome the status of poor or unstable network line quality, in the transmission process, if the communication line fails or the remote host fails, the local application will not be affected. You can continue to send data without waiting for network failure recovery or the remote host to run again.
In MQ, queues are divided into many types, including: local queues, remote queues, template queues, dynamic queues, alias queues, and so on. The local queue is also divided into ordinary local queues and transmission queues, the normal local queue is the application through the API read and write operations of the queue, the transmission queue can be understood as a storage-forwarding queue, such as: We sent a message to the MQ system to send to the remote host, while the network has failed, MQ will place the message in the transmit queue and then send it to the remote destination when the network resumes. A remote queue is a local definition of a destination queue, which resembles an address pointer to a destination queue on a remote host, which is only a definition and does not really occupy disk storage space. Template queues and dynamic queues are a feature of MQ, a typical use of which is to be used as a system extensibility consideration. We can create a template queue, and when new queues are needed, each time a template queue is opened, MQ automatically generates a dynamic queue, we can also specify that the dynamic queue is a temporary queue or a permanent queue, and if it is a temporary queue we can delete it while shutting it down, instead, if it is a permanent queue, We can keep it forever and use it for me.
4. Channel
A channel is a conduit for passing messages between queue managers in an MQ system, a logical concept built on top of a physical network connection, and the essence of MQ products. In MQ, there are three main classes of channel types, the message channel, the MQI channel, and the cluster channel. Message channels are used to transfer messages between MQ servers and servers, it is emphasized that the channel is one-way, it has send (sender), receive (receive), requestor (requestor), service (server) and other different types, For use by users in different situations. The MQI channel is used to communicate and transmit messages between MQ client and MQ server, unlike message channels, where the transmission is bidirectional. The cluster (Cluster) channel is used for communication between queue managers that are located inside the same MQ cluster.