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 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.