Tencent Cloud Cloud Message Queue (CMQ) is a distributed message queue service featuring a reliable message-based async communication mechanism that enables message receiving/sending among different applications deployed in a distributed manner (or different components of the same application) and stores the messages in reliable and valid CMQ queues to prevent message loss. It supports multi-process simultaneous read-write so that message sending and receiving do not interfere with each other, eliminating the need for the applications or components to run continuously.
CMQ can efficiently send/receive and push tens of millions of messages and retain an unlimited number of messages. It features an extremely high throughput and can process over 100,000 queries per second (QPS) with one single cluster, fully meeting the messaging needs of your businesses.
When each message is returned to the user, CMQ writes three copies of the message data to different physical servers so that when one of the servers fails, the backend data replication mechanism can quickly migrate the data. With three backups of user data available at any time, CMQ can guarantee up to 99.999999% reliability and 99.95% business continuity. In addition, CMQ adopts the Raft algorithm to achieve strong data consistency.
The underlying system automatically scales the number of queues and queue storage capacity according to business size without affecting the user experience. Currently, this is available in multiple regions such as Beijing, Shanghai and Guangzhou. With smooth scale-out, a single CMQ cluster boasts over 100,000 QPS and a single CMQ queue can logically provide messaging services across multiple clusters.
CMQ supports HTTPS-based secure access and utilizes Tencent Cloud's multi-dimensional security protection to defend against network attacks and protect the privacy of your businesses. Plus, it supports managing master/sub-accounts and collaborator accounts for fine-grained resource access control.
CMQ provides APIs and SDKs for various languages such as Java and C++ to reduce your development costs and facilitate cloudification. It features multi-dimensional monitoring and alarms, eliminating your concerns over the OPS of underlying resources and enabling you to instead focus on business development.
After sending a message to the message queue, the message sender can immediately return without needing to wait for the recipient's response. The message will be saved in the queue until it is retrieved by the recipient. The sending and processing of the message are completely async.
Traditionally, a message request could 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 to the recipient.
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 have to know who the recipient is, clarifying the system design. In contrast, if a remote procedure call (RPC) or socket connection is used between processes, when one party's API, IP or port changes, the other party must modify the request configuration.
A direct connection is not required between the sender and the recipient because 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.
Messages can be sent or received among multiple business terminals, and CMQ controls the availability of messages via message status.
Queues can be configured independently and do not need to be identical. Queues can also be customized for different business scenarios. For example, the properties of a queue that has a relatively long message processing time can be optimized.
The benefits of CMQ are well-reflected in the distributed transactions of WeChat's red packet system. The WeChat architecture team has integrated CMQ into the red packet system to reduce its distributed transactions overhead. The CMQ red packet queue ensures the reliable delivery and storage of red packet messages. If the funds fail to be credited, the account system will continue pulling from the CMQ to retry the update operation, ensuring that the crediting message will never get lost and avoiding drawbacks such as rollback upon crediting failure and frequent database polling. Learn more.
The CMQ backend cluster is transparent and imperceptible to the user, and the CMQ controller server can schedule and relocate queues in real time according to the load of the cluster. If the request volume of a queue exceeds the service threshold of the current cluster, the controller server can distribute the queue routes to multiple clusters to increase the number of processable concurrent requests. In theory, CMQ can achieve unlimited message retention and extremely high QPS, enabling you to easily cope with your ever-changing business needs.
CMQ meets two core requirements:
CMQ supports deploying two sets of CMQ clusters (such as Shenzhen Pingshan and Guanlan) in a finance data center (two availability zones), and allows you to write messages to either zone based on your actual needs.
Different policies, including sync storage (for strong consistency) and async storage (for eventual consistency), can be selected when storing the message body according to your business characteristics.
In rare cases where the message queue data of the primary node is completely lost, the RPO of the primary/secondary nodes is within five minutes. Tencent Cloud provides APIs for failover and failback, giving you control over disaster recovery and switchover. After the switchover is prepared, differences in the data may exist, and other databases can be associated for reconciliation to complete the data.
The bank-grade disaster recovery solution safeguards core businesses such as WeBank and Tenpay to ensure smooth operations.
Currently, CMQ's queue service and topic mode are free of charge.