JMS Overview Select Blog from LegendInfo

xiaoxiao2021-03-06  37

1 JMS overview

The JMS API includes the following:

l What is a message?

l What is JMS API?

l When will I apply JMS API?

l How does JMS API work with J2EE?

1.1 What is a message?

The message is a communication method between software components or applications. The message system is a peer-to-peer system: Message Customers can send messages to other customers, or receive messages from other customers. Each customer is connected to a message agent, providing service, sending, receiving, and reading a message by the message agent.

Message enables loosely coupled distributed communication. The component sends a message to the purpose, the message recipient extracts the message from the purpose. However, the transmission and reception of the message is not simultaneously performed. In fact, the sender does not have to understand the recipient, and the same recipient does not have to know the sender; they only need to know the message format and message purpose. Therefore, the message is different from the tightly coupled communication method like a remote method (RMI), and the RMI requires a method of knowing the remote application.

The news is also different from email (E-mail), email is a communication method between people or applications and people. The message is applied only to communication between applications and components.

1.2 What is JMS API?

Java Message Service is a set of Java Applications (Java API), which provides services for creation, sending, receiving, and reading messages. The JMS API designed by Sun Company and its partner defines a set of common application interfaces and corresponding syntax that allows the Java program to communicate with other message components.

The JMS API minimizes the concept of programmer learning to use the message product, but it provides sufficient functions to support complex messaging applications. With the same message domain in the JMS provider, it maximizes the portability of the message application.

JMS API not only makes communication loose coupling, but it also makes communication:

l Asynchronous: JMS provider sends the coming message to the customer, the customer does not have to send a request to receive the message.

l Reliable: JMS API ensures that the message is transferred once and only once. Reliable-poor applications may lose messages or repeatedly receive messages.

The JMS specification was released in August 1998. The latest version is 1.0.2b, released in August 2001. You can download the latest specifications from http://java.sun.com/products/jms/docs.html.

1.3 When is the JMS API?

Enterprise-level application vendors may choose a closely coupled message API (for example: RPC):

l The vendor wants that the component does not rely on interface information of other components, so that components become easy to replace.

l Suppliers want to run applications regardless of whether all components are running properly.

l The commercial logic of the application requires the component to send information to other components, and can be operated without timely replies.

For example, a car manufacturer's enterprise application component can use JMS API in the following situations:

l When the inventory level is below normal, the inventory component sends a message to the manufacturing assembly.

l Manufacturing components Send messages to part components such that it can collect the parts they need.

l Partitions Next, send messages to inventory components and order components, require updating stocks, order new parts from the supply unit.

l Manufacturing and part components can send information to accountant components, requiring them to update their budget.

l Send the product catalog to the Sales Department.

Use the message to complete the above tasks, allowing energy between different components to be used, not to arrange superior sector management control and other resources.

Manufacturing is just how companies apply

An example of a JMS API. Message applications can also be used in other industries such as retail, financial services, public health services.

1.4 How does JMS API work with the J2EE platform? When the JMS API is first released in 1998, its most important goal is to enable Java applications to access existing messages, such as IBM's MQSeries.

Since then, many manufacturers have begun to choose the JMS API, so JMS products can provide more complete message performance for companies.

In J2EE 1.2, J2EE-based service providers are required to support JMS APIs, but do not require full implementation. Now, in J2EE 1.3, JMS API is part of the platform. Application developers can use the message function of the J2EE component.

The JMS API in J2EE 1.3 has the following characteristics:

l Application client. EJB components, web components can send or synchronize to receive JMS messages. The application client can also receive JMS messages asynchronously. (Applets does not require JMS API)

l Newly introduced EJB - message beans can process messages asynchronously. JMS Provider (JMS Provider) can use message beans to implement concurrent processing of messages.

l You can send and receive messages in a distributed transaction.

The introduction of the JMS API simplifies the development of business logic, allowing loosely coupled, reliable, asynchronous communication J2EE components and vintage messages to communicate, greatly enhances the function of the J2EE platform. Developers easily add new features to existing J2EE-based applications

The J2EE platform EJB container supports distributed transactions and can handle concurrency messages, greatly enhance the functionality of the JMS API.

J2EE1.3 Another new introduction technology - Jee connector sets J2EE applications and existing enterprise information systems (ENTERPRISE INFORMATION SYSTEM). The JMS API is reversed, which makes J2EE applications and existing enterprise information systems become loose and coupled.

转载请注明原文地址:https://www.9cbs.com/read-72127.html

New Post(0)