There are two basic communication methods: time-based synchronization mode and time-independent asynchronous mode. Message transmission middleware has many different types, which support one basic type of message communication, and sometimes two types of communication.
According to the definition, the synchronous execution feature is: synchronization must be performed between two communication application systems, both systems must be running normally, and the execution stream of the client is interrupted and calls are executed in turn. Both the sender and receiver must always be prepared to communicate with each other. The sender first initiates a request (send a message) to the receiver ). The sender immediately blocks its own processes until it receives the response from the receiver. After receiving the response, the sender continues to process it. Synchronous request/response communication 2.6 is shown. In Section 2.4, we will discuss a specific instance of synchronous communication-remote process call.
When asynchronous message transmission is used, the caller can process other tasks without waiting for a response after sending the message. For Asynchronous Communication, an application (either the requester or the sender) sends the request to another application and can continue to execute other tasks of the application. The sender can continue to process other requests without waiting for the execution and return results of the receiver. Different from the synchronous mode, the two application systems (sending and receiving programs) in asynchronous mode do not need to be running at the same time, and do not need to process communication tasks at the same time.
Generally, the queuing mechanism is used for asynchronous message transmission. There are two different types of queuing Methods: storage/forwarding, publishing/subscription. In section 2.5, we will discuss these two queuing methods.
When selecting the type of communication mode, you must carefully consider the advantages and disadvantages of loose and tightly coupled interfaces, as well as the advantages and disadvantages of asynchronous and synchronous interactions. In the following two sections, we will discuss these communication methods in more detail.