Message-oriented middleware (MOM) Representative JMS

Source: Internet
Author: User
Tags sub domain

Http://blog.csai.cn/user1/25929/archives/2008/32570.htmlat present, CORBA, DCOM, RMI and other RPC middleware technologies have been widely used in various fields. But in the face of distributed systems with increasing scale and complexity, these technologies also show their limitations: (1) synchronous communication: After a client makes a call, it must wait for the service object to complete processing and return the results before continuing ; (2) The life cycle of customer and service objects is tightly coupled: both the client process and the service object process must function correctly, and the customer receives an exception if the client's request is not reached due to a crash in the service object or a network failure; (3) Point-to-Point communication: A call from a customer is sent only to a single target object. Message-oriented middleware (oriented Middleware,mom) solves the above problems better. The sender sends the message to the message server, which stores the message in several queues and forwards the message to the recipient at the appropriate time. In this mode, sending and receiving are asynchronous, the sender does not have to wait; the life cycle of the two is not necessarily the same: the receiver does not necessarily run when the message is sent, and the sender does not necessarily run when the message is received; One-to-many communication: There can be multiple receivers for a message. Existing MOM systems include IBM's MQSeries, Microsoft's MSMQ, and Bea's Messageq. Without a common standard, it is difficult for these systems to interoperate and connect seamlessly. The Java message Service (JMS) is the specification that Sun proposes to unify the various MOM system interfaces, which includes point-to-point to POINT,PTP and publish/subscribe (PUBLISH/SUBSCRIBE,PUB/SUB) Two messaging models , providing reliable message transmission, transaction and message filtering mechanisms.
1.JMS
The Java Messaging Service (JMS) defines the interface for accessing message middleware in Java. JMS is just an interface and is not implemented, the message middleware that implements the JMS interface is called the JMS Provider,ilink implements the JMS interface, and the user can do JMS programming in Ilink by using the JMS interface. Ilink supports JMS1.0.2 version.
2.JMS Interface Description
JMS supports two message types, PTP and pub/sub, respectively: PTP domain and Pub/sub domain, both of which inherit a unified JMS parent interface.
3.JMS Message Model
A JMS message consists of the following parts: A message header, a property, a message body.
In addition to the standard attributes defined in the message header, JMS provides a mechanism for adding new attributes to the header, which includes the following:
1. Applications need to use the attributes; 2. Some optional attributes of the message header; 3. JMS Provider The properties you need to use.
4. Synchronous reception of messages synchronously receive messages is the client's initiative to receive messages, and JMS clients can receive the next message using the Messageconsumer receive method. Asynchronous reception of a message is the initiative to notify the client when the message arrives. JMS clients can register an object that implements the MessageListener interface to Messageconsumer, so that whenever a message arrives, the JMS Provider invokes the OnMessage method in MessageListener.
5. PTP Model
The PTP model is point-to-point, the sender sends messages to the queue, the receiver receives the message from the queue, and the presence of the queue makes the asynchronous transmission of the message possible. As with mailboxes in the messaging system, queues can contain various messages, and the JMS Provider provides tools to manage the creation and deletion of queues. The JMS PTP model defines how clients send messages to queues, receive messages from queues, and browse messages in queues. Publish and subscribe messages, which are called themes (topic). A topic can be considered a transport intermediary for a message, a publisher (publisher) publishes a message to a topic, and a Subscriber (subscribe) subscribes to a message from a subject. Themes make it possible for message subscribers and message publishers to remain independent of each other and to guarantee the delivery of messages without contact.

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.