Message technology simple notes

xiaoxiao2021-03-05  21

I saw a little message in the middle of the newspaper, let's write down.

1, message middleware

The message middleware is to create a low-coupled logical channel for systems that need to pass messages, which can cross the platform and operating the system.

The message system has synchronous and asynchronous points, and the asynchronous message system has mainly used both broadcast and publish / subscribers.

Asynchronous message system is widely used.

2, JMS

JMS is a standard in a Java domain, and JMS defines an interface to access the message middleware in Java. JMS itself has not been implemented, but is ultimately implemented by the news middleware developer. It is not all the news middleware to support JMS, such as Microsoft's MSMQ, supported products mainly have the following:

The basic work that JMS applications must be completed:

· Create connectivity and sessions

· Create a message producer and consumers

· Send and receive messages

Message systems typically have two messages.

1, Publish / Subscribe (Publish / Subscribe)

The publish / subscription message system supports an event-driven model, message generator, and user participating in the message. Generator publishing an event, while the user subscribes to the incident of interest and uses an event. Generator will connect messages and a specific topic (Topic), and the message system transmits the message to the user according to the interest of the user registered.

(Publish / Subscribe (Pub / Sub) Messaging

2. PEER TO Peer In the message system of point-point, the message is distributed to a separate user. It maintains an "enter" message queue. Message application sends a message to a specific queue, and the client gets a message from a queue.

(Point-to-Point (PTP) Messaging

3, development:

Connection plant

Corresponding to the basic work and two basic types of JMS: JMS connecting the factory in QueueConnectionFactory and TopicConnectionFactory.

Session builds producer / consumers

4, example

转载请注明原文地址:https://www.9cbs.com/read-36833.html

New Post(0)