Last updated: 2020-02-26 20:10:35PDF
Async Communication Protocol
The message sender can immediately return after sending a message to the message queue without needing to wait for the recipient's response. The message will be saved in the queue until taken out by the recipient. The sending and processing of the message are completely async.
In traditional mode, a message request may fail due to extended wait time. However, with CMQ, if the recipient is unavailable when a message is sent, CMQ will retain the message until it is successfully delivered.
CMQ helps reduce the degree of coupling between two processes. As long as the message format stays unchanged, no changes will be made for the sender even if the recipient's API, location or configuration changes. Moreover, the message sender does not need to know who the message receiver is, which makes the system design clearer; on the contrary, the process uses a remote procedure call (RPC) or socket connection, and when one party's interface, IP, or port changes, the other party must modify the request configuration.
A direct connection is not required between the sender and the recipient, as CMQ guarantees that the message can be routed from the former to the latter. Message routing is even available for two services that are not easily interconnectable.
Multiple parts of the user system can send or receive messages simultaneously, and Tencent Cloud CMQ controls message availability through message status.
Queues in different business scenarios can be customized. For example, if a queue has a longer message processing time, the queue properties can be optimized.
Cloud function trigger
The CMQ topic can pass the message to the function and call the function by using the message content and related information as parameters.