In distributed enterprise applications, asynchronous messaging mechanisms are used to effectively coordinate the work of various parts.
Java EE provides us with JMS and message-driven beans (message-driven beans) to implement asynchronous messaging between parts of the application.
A What is a messaging system?
Typically, a message system allows for reliable asynchronous communication between separate, decoupled applications. In enterprise applications, an asynchronous, non-blocking message delivery is required. For example, a client might want to send a request to a server, regardless of whether it immediately gets a response. In this way, the client has no reason to wait for the server to process the request. After a client application submits a request, it can handle other tasks simply by making sure that the request arrives on the server side. Usually, this is very efficient. Message systems provide many of the advantages that are not available in other distributed object computing models. It encourages "loose coupling" between the message creator and the consumer, and there is a high degree of transaction processing between them. For the user, it does not care who generated the message, whether the creator is still on the network, and when the message was generated. This allows for the establishment of dynamic, reliable and flexible systems. The entire subsystem can be modified without affecting other parts of the system.
Additional advantages include: Highly scalable systems, easy integration with other systems, and high reliability. Because of their reliability and scalability, they are used to solve many business and scientific computing problems. For example, messaging systems are the basis for many applications that can be workflows, network management, communication services, or supply chain management programs. In Java technology, the ability to process asynchronous messages is achieved through JMS. JMS was originally designed to provide a standard Java interface for traditional message object middleware. These products are required in an enterprise-class application. There are a number of pure Java products that support JMS.
Message system Type
There are usually two types of messages.
1. Publish/Subscribe (publish/subscribe)
The Publish/Subscribe message system supports an event-driven model in which both the message creator and the consumer participate in the delivery of the message. The creator publishes the event, while the consumer subscribes to events of interest and uses the event. The creator links the message to a specific topic (TOPIC), which is passed on to the user in accordance with the user's interest in registering the message.
2. Point to Point (Peer to Peer)
In a point-to-point messaging system, the message is distributed to a single user. It maintains a "enter" message queue. The messaging application sends a message to a specific queue, and the client gets the message from a queue.