Build JEESZ distributed architecture 9-Introduction to message-oriented middleware and jeesz9 --

Source: Internet
Author: User

Build JEESZ distributed architecture 9-Introduction to message-oriented middleware and jeesz9 --

Introduction to message-oriented Middleware

1. Role of message-oriented middleware in JEESZ distributed architecture

1) message-oriented middleware sends and receives messages in a distributed system.

2) message-oriented middleware can use an efficient and reliable message transmission mechanism to exchange platform-independent data and integrate distributed systems based on data communication.

3) communication between processes can be extended in a distributed environment by providing message transmission and Message Queuing Models.

4) message-oriented middleware enables reliable asynchronous communication between applications or components to reduce coupling between systems and improve system scalability and availability.

2. JMS: Java Message Service

1) JMS is a message specification in JavaEE and a set of Apis irrelevant to specific platforms.

2) JMS element:

JMS provider ---- connect to an implementation of the JMS interface for message-oriented Middleware

JMS customer ------ Java-based applications or objects that produce or consume messages

JMS producer-create and send a message to the JMS Client

JMS consumer-the JMS customer who receives the message

JMS message ------ objects of data that can be transferred between JMS customers

JMS queue ------ a region that holds messages sent waiting for reading

JMS topic ------ A mechanism that supports sending messages to multiple subscribers

3) JMS application interface

ConnectionFactory: The managed object used by the user to create a connection to the JMS provider.

Connection: the Connection represents the communication link between the application and the message server.

Destination: the location where messages are published and received, queue, or topic.

MessageProducer: an object created by a session used to send messages to the target.

MessageConsumer: an object created by a session to receive messages sent to the target.

Message: an object transmitted between the consumer and the producer.

Session: indicates the context of a single thread, used to send and receive messages.

4) JMS message model

1. Point-to-point or Queue Model

 

  • The message producer sends the production message to the queue, and then the message consumer extracts and consumes the message from the queue.
  • After a message is consumed, it is no longer stored in the queue, so the message consumer cannot consume the message that has been consumed.
  • Queue supports multiple consumers, but only one consumer can consume one message.

2. Publisher/subscriber Model

 

 

 
   

 

  • The message producer (publish) publishes a message to a topic, and multiple message consumers (subscribe) consume the message. Messages published to a topic are consumed by all subscribers.

Note: JEESZActiveMQ is used in the system.Middleware

Source Code address acquisition:Mingli.com

If you are interested, you can go to the ball ~ Sharing learning technologies: 2042849237

Related Article

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.