Synchronous message sending and asynchronous message sending

Source: Internet
Author: User

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.

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.