Basic concepts of MQ

Source: Internet
Author: User

1) Queue Manager

The queue manager is a top-level concept in the MQ system. It provides queue-based message services for us.

2) messages

In MQ, we define the data transmitted by the application to MQ as a message. We can define the message content and give a broad understanding of the message, for example: various types of data files of the user. The processing requests sent by an application to other applications can be used as messages. A Message consists of two parts:

Message Descriptor (Message discription or message header) describes the features of a message, such as the priority, lifecycle, and ID of a message;

The message body, that is, the user data. In MQ, messages are divided into two types: non-permanent (non-persistent) messages and permanent (persistent) messages. Non-permanent messages are stored in the memory, it is designed to improve performance. It cannot be restored when the system powers down or the MQ Queue Manager restarts. This type of message can be used when users have low requirements on message reliability and focus on system performance. For example, when publishing stock information, because the stock information is constantly updated, we may release it every several seconds, and new messages will continuously overwrite old messages. Permanent messages are stored on hard disks and recorded data logs. They have high reliability and ensure that messages are not lost or duplicated in the case of network or system faults.

In addition, there are also concepts of logical messages and physical messages in MQ. Using Logical messages and physical messages, we can segment large messages or combine several complete messages into a group of application logic for processing.

3) queue

A queue is a secure place for storing messages. A queue stores messages until they are processed by applications.

Message Queues work in the following ways:

A) program a forms a call to the Message Queue System. This call informs the message queue system that the message is ready and sent to program B;

B) The message queue system sends the message to the system where program B resides and puts it in the queue of program B;

C) after the appropriate time, program B reads the message from its queue and processes the message.

With advanced programming ideas and internal working mechanisms, MQ can ensure reliable message transmission in various network conditions and overcome the status quo of poor or unstable network line quality, during transmission, if the communication line fails or the remote host fails, local applications will not be affected. You can continue to send data, you do not have to wait for the Network to recover or the remote host to run normally.

In MQ, queues are divided into many types, including local queues, remote queues, template queues, dynamic queues, and alias queues.

Local queues are divided into common local queues and transmission queues. Common Local queues are queues for applications to perform read and write operations on them through APIS. Transmission queues can be understood as storage-forwarding queues, for example: we send a message to the MQ system and send it to the remote host. When the network fails, MQ stores the message in the transmission queue for temporary storage. When the network recovers, the message is sent to the remote destination.

A Remote Queue is a local definition of a destination queue. It is similar to an address pointer pointing to a destination queue on a remote host. It is just a definition and does not really occupy disk storage space.

Template queue and dynamic queue are a special feature of MQ. A typical purpose of them is to consider the scalability of the system. We can create a template queue. When a new queue needs to be added in the future, MQ automatically generates a dynamic queue every time a template queue is opened, we can also specify this dynamic queue as a temporary queue or a permanent queue. If it is a temporary queue, we can delete it while disabling it. On the contrary, if it is a permanent queue, we can keep it permanently for my use.

4) Channels

A channel is a pipeline for passing messages between queue managers in the MQ system. It is a logical concept built on a physical network connection and is also the essence of MQ products.

In MQ, there are three main channel types: Message channel, mqi channel, and cluster channel. The message channel is used to transmit messages between the MQ server and the server. It must be emphasized that the channel is one-way, and it also has a sender, receive (receive ), different types such as requestor and server are available to users under different circumstances. The mqi channel is used for communication and message transmission between MQ client and MQ server. Different from the message channel, the mqi Channel transmits messages in two directions. The cluster channel is used for communication between queue managers in the same MQ cluster.

 

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.