J2EE technical specifications (8)-JMS (message, domain)

Source: Internet
Author: User

As it is, continue to improve the J2EE technical specifications. This time, we will write a JMS program.

Understand the message-oriented middleware definition: Message

(1) message is a programmable mechanism for communication between two ends

(2) Some messaging technologies such:

    • TCP/IP sockets
    • MPs queue
    • File
    • Shared storage
Asynchronous Message:

(1) asynchronous message:

    • It is better to use asynchronous messages for Synchronous methods that only return NULL values.
    • Better server resource management

(2) Message Queue:

    • Improves performance
    • Allow priority setting (high-priority messages can be processed first)

Understanding basic concepts of JMS 1. Definition: Java Message Service

(1) Java Message Service (JMS) is a standard API for accessing message-oriented middleware.

(2) JMS has the following advantages:

    • Both parties can communicate even if one party is unavailable
    • Get faster performance by queue

Ii. Message structure

(1) A Message consists of the following parts:

    • 10 header fields
    • Property)Optional Fields
    • MessageBody

Iii. Definition: JMS Client

(1) a jms client is a Java client that produces or consumes messages.Program

(2) destination is the place where messages are waiting for processing on the JMS Server

4. Two types of domains (1) JMS defines two domains
    • Point-to-Point-To-point)

Point-to-Point queue

(1) Multiple senders can serialize messages to multiple recipients in the queue.

(2) messages are distributed to a single customer.

Publish/subscribe (Public/Subscribe)

Publish/subscribe topic

(1) publishing and subscription topics separate consumers and producers

(2) messages can be distributed to multiple subscribers.

Reliable subscribers

(1) The reliable subscription mechanism is longer than the connection between the client and the JMS supplier.

(2) Reliable subscribers

    • Register with a JMS supplier
    • When not activeYou can also obtain distributed messages.

(3) the JMS supplier is responsible for storing messages missed by reliable subscribers.

Finally, let's look at some terms and their domains:

The technology used by JMS is similar to the layer we have learned. This makes it easy for us to learn. Of course, other content of JMS is described in the next blog.

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.