Product overview

Ali Cloud Message Service (Message Service) is an efficient, reliable, secure, convenient and scalable distributed Message Service. MNS enables application developers to freely transfer data, notification messages, and build loosely coupled systems across distributed components of their applications.

Message service supports various types of message push at the same time, and seamless integration with the front and back end of SMS provides users with the ability to send mass SMS messages more efficiently.

Messaging services provide two models:

Queue model Topic model Differences between the two functional models:

The queue model supports one-to-one sending and receiving of messages; The topic model supports one-to-many publish and subscribe messages, and supports multiple message push modes. Introduction to the queue Model

The queue model is designed to provide a one-to-one consumption model with high reliability and high concurrency. That is, each message in the queue can be consumed by only one consumer.

Illustrate by analogy

The queue model is like a rotating sushi restaurant, where there are a number of sushi masters (producers) in the production of exquisite sushi (message), each sushi is unique, each customer (consumer) at the same time from the conveyor belt to take the favorite sushi for eating (consumption).

Diagram of queue model

Queue model characteristics

A. Rich configuration of queue attributes

We provide a variety of queue attribute configuration options. You can customize queue attributes to meet different application scenarios, including common queue, delay queue, and priority queue.

B. Supports massive concurrent access

Supports concurrent access by multiple producers and consumers to the same queue, and ensures that a message cannot be retrieved by other consumers for a specified period of time after it is fetched. The number of concurrent accesses can be scaled freely based on business requirements.

C. Message delivery guarantee

Ensure that the message is successfully consumed at least once during its lifetime. Access ali Cloud account system to isolate resources between users to ensure that messages in your queue will not be obtained illegally.

D. Distributed transaction messages

Perfect transaction message solution in distributed environment.

E. Log management is supported

You can view the complete lifecycle of sending, receiving, and deleting messages through log management. You can use log management to conveniently investigate problems.

For details, see Log Management

F. Cloud monitoring is supported

Users can check the queue situation through cloud monitoring, and can customize alarm items. When the queue situation does not meet expectations, it can be timely informed.

For details, see Cloud Monitoring, Cloud Monitoring Console

Introduction to the Topic Model

The topic subscription model aims to provide one-to-many publishing subscription and message notification functions, supporting users to realize one-stop multiple message notification methods:

Push to user-specified HttpServer Push to user-specified Queue (from which users can pull messages) push to mail (group) push to SMS (list) Push to WebSocket (to be supported) Mobile push (plan support) analogy example

A topic is like a newspaper. Multiple customers go to the post office to subscribe to the newspaper. When the latest issue of the newspaper is released, customers (including the partners of the post office) can choose the following ways to obtain the newspaper:

Have postmen deliver newspapers to a particular address (home) and pick them up at the nearest subscription (newsstand). (Newspapers will be delivered to each kiosk by postmen first) Let post offices directly send the electronic version of newspapers to their designated mailboxes. Let post offices send newspaper newsletters to their mobile phones by SMS. Let post offices directly push the electronic version of newspapers to multiple connected terminals through WebSock The newspaper can directly push the electronic version of the newspaper to the mobile APP by specifying the mobile push access point. Schematic diagram of theme model:

Description:

As you can see, there are multiple subscriptions on Topic that are pushed to HttpServer, Queue, mailbox, and so on. As shown in the figure, once a message is published to a Topic, it is pushed to the Endpoint specified by a different subscription. As shown in the figure, the subscription supports message filtering, and you can specify filter labels in the subscription. For a subscription that does not specify a filter label, the message can be pushed to the specified receiver regardless of whether the filter label is specified. For a subscription (Subscription2) with a filter label specified, a message sent will only be pushed to the specified receiver if a matching label (red message B) is specified. Topic model characteristics

Notification messages One-to-many broadcast messages Message label filtering Multiple delivery modes Message delivery guarantee Cloud product event notification Log management Cloud monitoring A. Support notification messages

1) The MNS server takes the initiative to push the message to the callback address specified by the user (message notification address) to eliminate unnecessary polling and resource consumption of the client program. Users can concentrate their resources in the logic that handles their own business. It also avoids the dependency on other message service product clients and avoids the stability of its own services due to the introduction of too much code.

For details, see: HttpEndpoint processing, HttpEndpoint signature, HttpEndpoint Java, and HttpEndpoint local Debug tools

2) At the same time, MNS can also push messages to the Queue if it is not convenient for users to provide callback addresses due to network or other reasons. Users can still directly get messages from the Queue. Consumers who previously used the “queue model” can seamlessly consume messages in topics.

See Queue push, broadcast pull message

B. Supports one-to-many broadcast messages

1) A message published to a topic can be subscribed by multiple subscribers at the same time, and will be pushed to the destination according to the push mode and Endpoint address specified by multiple subscriptions. The user can receive the message from multiple channels at the same time.

2) Users can push messages to multiple receivers only after publishing once, ensuring atomicity of message publishing.

C. Supports message label filtering

In addition to support for one-to-many broadcast messages, filtering of messages is supported in subscriptions. You can subscribe to messages with specific labels in a Topic. Specify a message filter label when creating a subscription, and then specify a message filter label when publishing shMessage. MNS will filter messages based on the label when pushing messages, and only push messages matching the filter label specified in the subscription to the specified Endpoint.

See topic interface specification for details.

D. Support multiple delivery methods

MNS supports a variety of message delivery methods, including but not limited to:

Push to Http(S)Server. For details, see HttpEndpoint Processing, HttpEndpoint Signature, HttpEndpoint Java, and HttpEndpoint Local Debug tools. Push to Queue, see Queue push, broadcast pull messages. Push to mailbox, see: Email push. Push to SMS. For details, see SMS push. Access WebSocket push (support coming soon). Access mobile push (planning support). E. Message delivery guarantee

Guarantees that messages published to a Topic are pushed to user programs according to the specified policy and format for the duration of the message. Push strategies include:

BACKOFF_RETRY Retry three times. The interval between 10 and 20 seconds is random

EXPONENTIAL_DECAY_RETRY 176 times. The retry interval increases to 512 seconds, and the total retry time is 1 day. The specific retry interval is 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512… 512 seconds (167 512)

Push message formats include:

XML: The message body is in XML format, containing the message body and message attributes. JSON: The message body is in JSON format, containing the message body and message attributes. SIMPLIFIED (text format) : The message body is the message published by the user and contains no attribute information. See: NotifyStrategy, NotifyContenFormat

F. Support cloud product event notification

MNS provides the function of event notification. Users can create event notification rules on MNS to pay attention to the events generated on the specified resources of other Aliyun products, and MNS will actively push the events to the specified receiver in the form of messages. The OSS is connected to the OSS system. Users can use the event notification function to monitor and process events such as Bucket management events and Bucket Object creation, deletion, and update.

See: Event Notification

G. Supports log management

You can use log management to view the records of each message published to a topic and each message pushed to users, including retry push records and push results. The ability to show the life cycle of each message. You can use log management to conveniently investigate problems.

For details, see Log Management

H. Cloud monitoring is supported

You can view the record of message push through cloud monitoring to timely view and monitor the situation of message push. When there are a lot of push failures, you can know them in time by adding alarms.

For details, see Cloud Monitoring, Cloud Monitoring Console

SMS sending capability

The message service also provides communication services, including sending verification codes, SMS notification, and SMS promotion. During the Double 11, 200 million users sent 600 million text messages. Exclusive channel with three networks in one, real-time connection with the platform of the Ministry of Industry and Information Technology. Carrier-grade operation and maintenance guarantee, automatic switching of monitoring at all times, arrival rate up to 99%.

SMS notification and verification code

Large capacity and high concurrency: 200 million users can send 600 million SMS messages during double 11. It can be reached in 3 seconds, and it is an exclusive channel with three networks in one, which is connected with the platform of the Ministry of Industry and Information Technology in real time. Flexible variables, variable support, flexible content, adaptable to support various business scenarios.

Promotion of SMS

Support SMS distribution of a variety of promotional content, to improve the exposure of enterprise products to provide help. Send SMS messages for business promotion, new product promotion, member care, etc.

Batch send

One-to-many broadcast messages. A message published to a topic can be subscribed by multiple subscribers at the same time, and will be pushed according to the push mode and Endpoint address specified by multiple subscriptions.

Asynchronous notification

You can call back to notify the user when the back-end service process completes the task. This reduces the number of unnecessary polling requests between users and Web front-end and back-end services.

Data statistics

You can view the number of requests, the number of successful sending, the number of failures, and other statistics; You can view sending details by date and mobile phone number.

Details about Ali Cloud messaging service:

Ali cloud message service use tutorial

Ali Cloud Message Service (MQS) is the commercial Message middleware Service of Ali Cloud. Different from the traditional message middleware, the message service is designed and implemented based on the Feitian distributed system independently developed by Ali Cloud at the very beginning, which has the characteristics of large-scale, high reliability, high concurrent access and super message accumulation capacity. The API of message service adopts HTTP RESTful standard, which is easy to access and has strong cross-network capability. Access to resource Access control services (RAM) and private networks (VPC) to support secure access control. Access to cloud monitoring to provide a sound monitoring and alarm mechanism. Messaging services provide rich SDKS, solutions, best practices, and 7×24 technical support to help application developers freely transfer data between application components and build loosely-coupled, distributed, and highly available systems.

The message service can also send SMS messages, including verification codes, SMS notifications, and promotion SMS messages. 200 million users sent 600 million text messages during singles’ Day. Exclusive channel with three networks in one, real-time connection with the platform of the Ministry of Industry and Information Technology. Carrier-grade operation and maintenance guarantee, real-time monitoring automatic switching, arrival rate up to 99%.)

Official website of Ali Yun University (Official website of Ali Yun University, Innovative Talent Workshop under cloud Ecology)