JMS learning SUMMARY iii
JMS body, phase, and usage
- JMS is a Standard Specification for generating, sending, and receiving messages.
- Multi-Application system communication can be implemented based on JMS specifications
- Supports secure topic message transmission, transactional messages, consistent messages, and persistent subscribers.
- One scenario of JMS (factory production ==> spare parts ==> procurement)
Two communication types of JMS
- Point-to-point (point-to-point), a message has only one receiver
- Publish/subscribe (publish/subscribe). A message can have multiple recipients.
- Use PTP messaging when every message you send must be processed successfully by one consumer.
- Use pub/sub messaging when each message can be processed by zero, one, or multiple consumers.
JMS Message Body
- Header: a standard field set. Both the client and service provider are used to identify and route messages.
- Property: Provides
Bean content set <type> property and get
<Type> property, optional support from service providers
- Body: Message content. Different message interfaces are specific to different content types.
Different JMS Message Types
Although the JMS type is different, it is implemented by the message interface.
- Streammessage: transmits the content of the Java-based basic stream.
- Mapmessage: a set of key-value content. The key is string and the value is the basic Java type.
- Textmessage: A large string
- Objectmessage: content that supports serializable
- Bytesmessage: byte stream content
- Xmlmessage: Extended textmessage, but it is much more convenient with the self-description operation.
Is the message received? Still not received!
The message validation mode is used to identify whether a message is received or not, and the message mode is not differentiated in transaction mode.
Five message validation Modes
- Auto_acknowledge: Automatic confirmation mode. If only the receiver receives the response, the exception is still normal.
- In client_acknowledge client validation mode, the receiver must call the acknowledge method. In other cases, it is deemed that the method is not received. Batch confirmation is required. The last or one message calls the acknowledge method.
- Dups_ OK _acknowledge allows repeated validation Modes
- No_acknowledge unconfirmed Mode
- Multicast_no_acknowledge: the unconfirmed Mode Under the IP Group Broadcasting
References
- Http://activemq.apache.org/
- Http://activemq.apache.org/version-5-getting-started.html
- Http://activemq.apache.org/examples.html
- Http://www.oracle.com/technetwork/java/jms/index.html
- Http://www.blogjava.net/baoyaer/articles/101077.aspx? Opt = Admin