Cloud Message Queue

A high-performance distributed message queue service

Overview

Tencent Cloud Message Queue (CMQ) is a distributed message queue service with a reliable message-based async communication mechanism, which 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.

Benefits

High Performance

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.

High Availability

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, we guarantee up to 99.999999% reliability and 99.95% business continuity. In addition, the Raft algorithm is adopted to achieve strong data consistency.

High Scalability

The underlying system automatically scales the number of queues and queue storage capacity according to business size without affecting user experience. Currently, this is available in multiple regions such as Beijing, Shanghai and Guangzhou. With smooth scale-out, one single CMQ cluster boasts over 100,000 QPS and one single CMQ queue can logically provide messaging services across multiple clusters.

Security and Reliability

CMQ supports HTTPS-based secure access and utilizes Tencent Cloud platform's multi-dimensional security protection to defend against network attacks and protect the privacy of your businesses. Plus, it supports management of master/sub-accounts and collaborator accounts for fine-grained resource access control.

Ease of OPS-free Use

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 alarming, eliminating your concerns over OPS of underlying resources and enabling you to focus on business development. 

Features

Featuring a reliable async communication mechanism, CMQ is dedicated to providing async messaging services for your businesses.
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.

Scenarios

Permanently Available Messages (WeChat)

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 the overhead of distributed transactions on the system. The CMQ red packet queue ensures 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 the drawbacks such as rollback upon crediting failure and frequent polling of the database. Learn more.

High Scalability

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 ever-changing business needs.

CMQ is able to meet two core requirements:

  • Fund crediting is async in a promotion system. The crediting message is first written to the message queue and then is pulled out by the consumer. After the consumer confirms that the message is successfully consumed, the callback API will delete the message from the queue.
  • Major systems such as OPS, alarming and operations generate massive volumes of logs. The logs are first aggregated into CMQ and the backend big data analysis clusters continuously pull them out of CMQ and analyze them based on the processing capabilities. CMQ can theoretically retain an unlimited number of messages, bringing you peace of mind when using it.
Intra-city Disaster Recovery

CMQ supports the deployment of two sets of CMQ clusters (such as Shenzhen Pingshan and Guanlan) in a finance data center (two availability zones), and you can write messages to either zone based on actual needs.

Different policies can be selected for the storage of message body according to business characteristics, including sync storage (for strong consistency) and async storage (for eventual consistency).

In rare cases where the message queue data of the master node is completely lost, the RPO of the master/slave 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, there may be differences in the data, and other databases can be associated for reconciliation to complete the data.

The bank-grade disaster recovery scheme safeguards core businesses such as WeBank and Tenpay for smooth operation.

Pricing

At present, the queue service and topic mode of CMQ are free of charge.