Basic concepts, functions, and features of JMS (organization)

Source: Internet
Author: User

1. Basic concepts of JMS
1. JMS (Java Message Service) is a standard API used to access the enterprise message system. It facilitates message systems.
Java applications in the system exchange messages, and simplify the development of enterprise applications by providing standard interfaces for generating, sending, and receiving messages.

2. Basic JMS Functions
JMS is an application interface used to communicate with message-oriented middleware. It supports point-to-point domains and publish/subscribe domains, and supports the following types: approved message transmission, transactional message transmission, consistent message, and persistent subscriber support. JMS also provides another way to integrate your application with the old background system.
3. WebLogic JMS server Introduction
WebLogic server8.1 complies with Java specifications and is recognized by Sun Microsystems J2EE 1.3
Certificate. as part of Weblogic, the Weblogic JMS server fully complies with the JMS specifications. It also supports clusters and can be applied to actual enterprise systems. is the Weblogic JMS server architecture. the figure shows the main components of Weblogic JMS server: Weblogic JMS servers (for message communication), Java client, JNDI (for domain name search), and backup storage (for persistent message storage, based on files or JDBC databases ).

Ii. WebLogic JMS features
1. Message Communication Model
JMS supports two message communication models: point-to-point (PTP) model and pub/Sub Model. Except for the following differences, these two message communication models are very similar:
The PTP model specifies that a message can have only one receiver. The pub/sub model allows a message to have multiple receivers.
2. Message Composition
The center of the message passing system is the message.
A message is divided into three parts:
· Header is a standard field set, which is used by clients and vendors to identify and route messages.
· Property supports adding optional header fields to messages. If your application needs to catalog and classify messages without using standard header fields, you can add an attribute to the message to implement this cataloguing and classification. The set <type> property (...) and get <type> property (...) methods are provided to set and obtain attributes of various Java types, including objects. JMS defines a standard property set provided by a vendor selection.
· The message body contains the content to be sent to the receiving application. Each message interface is specific to the content types it supports.
JMS provides different message types for different types of content, but all messages are derived from the message interface.
· Streammessage: contains basic java numeric streams, which are sequentially filled and read using standard stream operations.
· Mapmessage: contains a group of name/value pairs. The name is of the string type, and the value is of the basic type of Java.
· Textmessage: contains a string.
· Objectmessage: contains a serializable Java object. Collection classes that can use JDK.
· Bytesmessage: Contains uninterpreted byte streams: encode the subject to match the existing message format.
· Xmlmessage: contains XML content. Extends the use of textmessage and xmlmessage types to facilitate message filtering.
3. Message confirmation Mode
In non-transactional sessions, there are five validation modes for sessions created by the application, while in transactional sessions, the validation mode is ignored.
Five validation modes:
· Auto_acknowledge: automatic validation mode. Once the method call of the receiver application is returned from the processing message, the session object will confirm the receipt of the message.
· Client_acknowledge: client validation mode. The Session object depends on the application calling a acknowledge () method for the received message. Once this method is called, the session will confirm all received messages after the last confirmation. This mode allows the application to receive, process, and confirm a batch of messages in one call. Note: On the console, if the acknowledge Policy (validation Policy) attribute of the connection factory is set to "previous" (advance ), but if you want to confirm all received messages for a given session, use the last message to call the acknowledge () method.
· Dups_ OK _acknowledge: The validation mode of the replica is allowed. Once the method call of the receiver application is returned from the processing message, the session object will confirm the receipt of the message and allow repeated confirmation. This mode is very effective when you need to consider resource usage. NOTE: If your application cannot process duplicate messages, you should avoid using this mode. If the initialization attempt of the sent message fails, the duplicate message can be resent.
· No_acknowledge: the unconfirmed mode. Do not confirm that the received message is required. After messages are sent to a no_acknowledge session, they are immediately deleted by the WebLogic Server. In this mode, you cannot obtain received messages again, and the following results may be returned: 1. messages may be lost; and (or) another situation: 2. if the initialization attempt of the sent message fails, repeated messages may be sent.
· Multicast_no_acknowledge: the unconfirmed Mode Under the IP Group broadcasting. Confirmation is also not required. Messages sent to a multicast_no_acknowledge session share the same features as the no_acknowledge validation mode described earlier. This mode supports applications that want to communicate with messages through IP multicast, and does not need to rely on session validation to provide quality of service. NOTE: If your application cannot process message loss or duplication, you should avoid this mode. If the initialization attempt of the sent message fails, the duplicate message may be sent again.
Note: In the five validation modes listed above, auto_acknowledge, dups_ OK _acknowledge, and
Client_acknowledge is defined by the JMS specification. no_acknowledge and multicast_no_acknowledge are provided by Weblogic JMS.

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.