Introduction to JMS Apache activemq (message-oriented middleware)

Source: Internet
Author: User

First of all, when doing any technical pre-Research: what will I do to clear it? Why use it?

What is JMS?

Java Message Service is a set of interfaces and related semantics. It defines how JMS customers can access the functions of Enterprise message generation.

JMS supports two transmission modes of message-oriented middleware: point-to-point and pub/Sub ).

JMS message model:

Header: a jms header contains many fields. After a message is sent, it is generated by the JMS provider or message sender to indicate the message, set priority and expiration time, determine the route for the message.

Property: it is generated by the message sender and used to add and delete additional information other than the message header.

Body: the message body is generated by the message sender. Five types of message bodies are defined in JMS: bytemessage, mapmessage, objectmessage, streammessage, and textmessage.

Why use JMS?

  • A message is a distributed low-coupling communication solution. Producer A sends a message to the agent, and consumer B obtains the message on the agent. However, a and B do not need to register with the agent at the same time, the agent provides efficient communication services.
  • Security. Because AB is not associated, the restart and exit of one party will not affect the other.
  • Integrity judgment of messages. messages can be lost without strict transaction requirements.

Currently, most of the systems I work with are developed by one module per person and accessed through the HTTP interface. There are multiple user registration portals and user registration events are also assigned to different codes, which looks quite uncomfortable. Therefore, we decided to use JMS to process the logic after event triggering, reduces system coupling and facilitates code development and modification.

  1. The installation and configuration of activemq will not be described here. You can search for information on the Internet.
  2. The configuration files for activemq and spring collections are as follows:






Introduction to JMS Apache activemq (message-oriented middleware)

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.