Three: JMS Message Service Specification

Source: Internet
Author: User

One: What is JMS?
--->jms, the Java Message Service Application interface, is an API for message-oriented middleware (MOM) in a Java platform
---> is used to send messages between two applications, or distributed systems, for asynchronous communication.
--->java messaging Service is a platform-agnostic API, and most MOM providers support JMS.
---> JMS enables you to send messages from one JMS client to another through a messaging service (sometimes called a message broker or router).
--->jms (Java Messaging Service) is a technical specification for message-oriented middleware (MOM) on the Java platform that facilitates the message exchange of Java applications in the messaging system and provides standard generation, delivery, Interface to receive messages simplifies the development of enterprise applications and translates them into Java messaging Services

Two: What is a JMS message?
---> Message is a type object in JMS that consists of two parts: a header and a message body.
---> Header: Consists of the routing information and the metadata about the message.
---> Message body: The data or payload carrying the application.
---> Based on the type of payload, you can divide messages into several types, each carrying: simple text (textmessage), serializable objects (objectmessage), attribute collections (mapmessage), byte streams ( Bytesmessage), the original value stream (Streammessage), and a message with no payload.

Message header (required): Contains the action settings that are used to identify and find a route for the message.
A set of message properties (optional): Contains additional attributes that support compatibility with other providers and users. You can create custom fields and filters (message selectors).
A message body (optional): Allows the user to create five types of messages (text messages, map messages, byte messages, stream messages, and object messages).


Three: The role of JMS messages?
--->JMS customer: An application or object that produces or consumes message-based Java.
--->JMS producer: The JMS client that created and sent the message.
--->JMS consumer: The JMS client that receives the message.
--->JMS message: An object that includes data that can be passed between JMS clients
--->jms queue: An area that holds messages that are sent for waiting to be read. Unlike the meaning implied by the name of the queue, the order in which messages are received is not necessarily the same as the order in which the messages are sent. Once a message is read, the message is removed from the queue.
--->jms topic: a mechanism that supports sending messages to multiple subscribers.


Four: The JMS object model contains the following features:
1) connect the factory. The Connection factory (ConnectionFactory) is created by the Administrator and bound to the Jndi tree. The client uses Jndi to find the connection factory and then creates a JMS connection using the connection factory.
2) JMS connection. A JMS connection (Connection) represents an active connection between the JMS client and the server side, which is established by the client by invoking the connection factory method.
3) JMS session. A JMS session (session) indicates the state of the conversation between the JMS client and the JMS server. A JMS session is established on a JMS connection and represents a session thread between the client and the server.
4) JMS purposes. JMS Purpose (Destination), also known as Message Queuing, is the actual source of the message.
5) JMS producers and consumers. The producer (message Producer) and consumer (message Consumer) objects are created by the session object for sending and receiving messages.
6) There are usually two types of JMS messages:
① Point-to-point (point-to-point). In a point-to-point messaging system, messages are distributed to a single consumer. Point-to-point messages are often associated with queues (Javax.jms.Queue).
② Publish/Subscribe (publish/subscribe). The Publish/Subscribe messaging system supports an event-driven model in which message producers and consumers are involved in message delivery. Producers publish events, and consumers subscribe to events of interest and use events. This type of message is typically associated with a specific topic (JAVAX.JMS.TOPIC).

Three: JMS Message Service Specification

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.