All Products
Document Center

What is Message Queue?

Last Updated: Sep 14, 2019

Message Queue (MQ) is a professional message middleware as a core product in the enterprise-level Internet architecture. Based on the highly available distributed cluster technology, MQ provides a series of message cloud services, including message subscription and publishing, message tracing query, scheduled and delayed messages, resource statistics, monitoring, and alerts. With more than nine years of history, MQ provides asynchronous decoupling and load shifting for distributed application systems and supports features for Internet applications, including massive message accumulation, high throughput, and reliable retrying. It is one of the core products used to support the Double 11 Shopping Festival.

Multiple IDCs are deployed in a single region, ensuring extremely high availability. Even when one IDC completely fails, MQ can still provide a message distribution service for applications with no SPOF.

Currently, MQ supports access through TCP or HTTP. It also supports seven programming languages: Java, C++, .NET, Go, Python, Node.js, and PHP, to facilitate quick access to the cloud services of MQ for applications developed with different programming languages. You can either deploy your applications on Alibaba Cloud ECS instances or your own enterprise clouds or embed them into a mobile device or IoT device to connect with MQ for sending and receiving messages. Also, local developers can access MQ through the Internet to send and receive messages.


MQ supports access through TCP or HTTP and multiple programming languages, and offers multidimensional management tools. It provides a series of featured functions for different application scenarios.

Feature Overview

Support for TCP, HTTP, and STOMP

  • HTTP: MQ supports HTTP and RESTful, making it easy to use, fast to access, and powerful in cross-network access. Additionally, it supports clients developed in seven programming languages.
  • TCP: Different from the HTTP-based access mode of HTTP, the TCP-based SDK access mode is more specialized, reliable, and stable.
  • STOMP: Similar to the text-based protocol HTTP. This protocol is used for lightweight interaction between STOMP clients using script languages (such as Ruby, Python, and Perl) and MQ brokers.

Management tools

  • Web console: It supports topic management, producer management, consumer management, message query, message tracing, statistics, and monitoring.
  • API: It allows you to integrate MQ management tools into your own console.
  • mqadmin command set: A rich set of management commands for private clouds is provided for you to manage MQ by command.

Feature highlights

  • Transactional messages: MQ provides a distributed transaction processing function similar to X/Open XA to ensure transaction consistency.
  • Scheduled and delayed messages: MQ allows producers to specify the length of time to wait before a scheduled or delayed message is delivered. The maximum length is 40 days.
  • Large messages: A maximum message size of 4 MB is supported.
  • Message tracing: This records the complete route of a message from its publishing by the producer to the MQ broker and then to the consumer. This function facilitates troubleshooting.
  • Broadcasting consumption: Consumers identified by the same group ID can consume a certain message once.
  • Ordered messages: Message consumers can consume messages in the order in which messages are delivered.
  • Reset consumer offset: Users can reset the consumer progress by time to trace back messages or discard accumulated messages.
  • Dead-letter queues: Messages that cannot be consumed are stored to a special dead-letter queue for subsequent processing.
  • Message routers: These are used to synchronize and copy messages between instances in different regions all over the world, ensuring data consistency between regions.

Apsara Stack deployment

  • Customization: Technical solutions, and onsite technical support and training are provided.
  • Flexible deployment: MQ can be deployed in Apsara Stack separately or in a hybrid cloud.
  • O&M management: Apsara Stack supports such O&M tools as mqadmin command set and APIs to facilitate the management of platform integration and unified O&M.

Message sending and receiving model

MQ supports the publish/subscribe model. A message publisher (producer) can send a message to a topic of the broker and multiple message receivers (consumers) can subscribe to this topic to receive the message. The model is illustrated in the following figure.


For more information about MQ concepts, see Terms.