MQSeries allows the application to use the message queue to participate in the message-driven process. Applications can communicate with each other with appropriate message queue software products to cross the platform. Such middleware products block the underlying communication mechanism, reaching the surface harmonization of the message transmission and reception.
The MQSeries product implements a generic programming interface called a message queue interface (Message Queue Interface & MQI). This universal programming interface shields the differences in different operating systems, making you easily transplanted to another platform. For message queues, the interaction of messages is independent of time. That is, the program that is sent and received can be run asynchronously. The two are separated from each other, and the sender does not wait for the recipient feedback when sending the message. Even, when the message is sent by some part, the other party does not have to run, when she runs, she can retrieve the message. Once the message reaches the corresponding queue, the message can be used to activate the application of the target by a mechanism called triggering. It is necessary to use some settings, which can be automatically suspended after the message is processed.
Message, what? The message is a string of byte stream for the application. The message is used to transfer information. Of course, the information must be useful. MQSeries can run on different platforms. At this point, I have made a detailed description in the first one. The message in the MQ Series consists of two parts. The first part is the application of the application, the content, and structures are defined by the corresponding program. The second part is the message descriptor, she does the message, and includes additional information such as a message type, a sender assigned to the message. The message descriptor is defined by MQSeries. The maximum length of the message can reach 100 MB. In fact, the length of the message is determined by the following factors: 1, the maximum length definition of the reception queue; 2, the queue manager's message maximum length definition; 3, send or receive the program Definition; 4, available storage space.
What is the queue? The queue is a data structure used to store messages. The message can be sent by the app, or a queue manager is put into his queue. The maximum capacity of the queue is 2GB.
How does the application send and receive messages? Message queue interface calls are usually used (MQI Calls). For example, first call the desired queue through the MQI MQOPEN CALL; use the MQI MQPUT command to put the message into the queue; then, additional applications can retrieve the required messages from the queue through the MQI MQGET command. Of course, these two prices can be fully run asynchronously.
Queue can be divided into predefined queues based on their creation methods, dynamic queues. A predefined queue is created by an administrator using the appropriate command. This queue is permanent, and their presence or absence is independent of each other. Once MQSeries is restarted, they will start. When a request is issued by an Open command, a dynamic queue is created when a queue model is specified. Dynamic queue creates a definition of queue template. You can use the Define QModel command to define a queue template. This has some concepts of classes in object-oriented languages, some attributes in the dynamic queue, such as the maximum number of messages that can be accommodated is inherited from the template. There is still such an attribute in the queue template that you can specify that the created dynamic queue is permanent or temporary. In the queue manager, when using the queue's application to restart, the dynamic queue of the permanent property is started like the predefined queue, but the temporary property does not exist!
The program that has already been mentioned in the reception message can retrieve the news she needs in the queue without having to work when sending a message. Is this advantage that it is not like the current QQ or SMS! The same movement is wonderful! From the perspective of algorithm, authorized applications use the following algorithms: FIFO (first-in-first-out); there is a priority of the message defined in the message descriptor, that is, high priority messages The same priority is based on the FIFO algorithm; additionally, the application specifies the news she needs. Which search method is used depends on the MQGET request sent by the program. Objects, I am more and more object-oriented in MQSeries. There are also such integral properties, action, or functions in MQ, and abstracts such as process. In MQSeries V5.1, the object types include queue managers, queues, process definitions, pipelines, clusters (such as the queue manager clusters mentioned earlier), named table (Namelist).
Object control or management includes: start, end queue manager; create objects for applications, especially queues; creating communication paths (Paths) through pipes and queue managers running on other or remote systems Communication, with delivery messages; create queue manager clusters to simplify overall management processes, or to achieve a balanced workload. Naming conventions used in MQ depends on the object you want to create.
Each queue manager has its own unique name, in the interconnected queue manager, is unique to identify yourself. So, a queue manager can clearly indicate that the message should be sent to the target queue manager. And other types of objects, each has its own name. We can represent objects through the name. Natural these names are unique, a queue manager for some object type. For example, your MQ can have a queue and process of the same name, but it is absolutely not a queue of two identical names. I think the administrator when you create a new queue manager or object, the MQ Series system will definitely retrieve in the already named NameList, see if there is the same name. This is not the same as us, and the elders will know how many people in this world will be the same as those in this world! Nature, there is a lot of the same name. This is also why we have to use the ID card to identify a person! The ID card number is like the Object Name here!
In MQSeries, the name can be constructed up to 48 characters. Of course, anything seems to have exceptions. This is the hidden rule of the human world, I don't know if it is truth, or because the software products such as middleware are itself created, natural, will have a defect! Or is interested in the designer. For pipe, only 20 characters can be available.
You can create, change (ALTER), display (Display), delete (delete) object. The first is to execute by the control command; or the MQSeries command (MQSC), which can be entered from the keyboard, or read from the text; there is a programmable command format (Programmable Command Format / PCF), it is usually used In the automation. For example, the message from the remote is required to create an object to create an object, and can be implemented by this PCF. Based on MQSeries can also use the MQAI (MQSeries Administration Interface) to be used to implement the operation of the object. Of course, object operations under Windows NT have some special models, such as COM calls, dynamic directory service interface calls, MQ network management programs, etc. The object's properties determine its performance, feature. Some you can specify, some can only look at it. I think people who have learned to object-oriented language such as C should be easily understood here. Before you define the queue, you can specify the number of messages that it can have the most, but once you create it, you can only look at it. In MQ Series, there are two ways to review the properties of the object! One is the name of the PCF. For example, Maxmsglength. One is the MQSC name. For example, Maxmsgl. Queue Manager provides a queue service for the app and manages the queue she owns. She ensures that (1) change the object attribute based on the received command; (2) Once a predetermined situation is encountered, a particular trigger event is generated; (3) The message is put in the correct queue. The MQPUT call is issued according to the requirements. When not being executed, send information to the modified program, or the error code to respond to the source. Every queue belongs to a single queue manager. The queue is in the queue manager, I think it is like a multi-map. For queue managers, the queues it managed are local queues. Similar, there is also the concept of the local queue manager! But I think it is true that the difference between local and far ends should not be the main time when programming. Concepts are only help people understand, not a way to work! People tend to make new concepts on the basis of the concept, as things are constantly innovative, but in the face of fundamental issues, the solution is the same, or change the soup. Change your face!
42/445