How to use Ali cloud messaging services?


Ali cloud messaging services Tutorial: Ali Cloud University - developers classroom

Ali cloud messaging service (Message Service) is an efficient, reliable, safe, convenient, elastically scalable, distributed messaging services. MNS can help application developers deliver free data on the distributed components of their applications, notification messages, build loosely coupled systems.

Message Service and support various types of push notifications and seamless integration in which the front and rear end of the message is more efficient to provide users with the ability to send large quantities of SMS.

Message Service offers two models: the queue model; topic model

Two functions model differences:

One queue model supports sending and receiving messages;

Theme-many model supports publish and subscribe messaging, and support for multiple message push mode.

Introduction to queuing model

Queue model is designed to provide highly reliable high-consumption model one concurrent. That is, each message in the queue can be only consume a certain consumer.

Queue model characteristics

A. Rich queue attribute configuration

We offer a wealth of queue attribute configuration options that you can personalize queue attribute configuration to meet different application scenarios, support: general queue, delay queue, priority queue multiple modes queues.

B. massive support concurrent access

Producers and consumers to support multiple concurrent access to the same queue, and to ensure that a message was removed after a certain period of time, can not be obtained by other consumers. Free to expand the number of concurrent access based on business needs.

C. guarantees message delivery

Within the validity of the message, the message can be sure that at least once a consumer success. Ali cloud account access systems, resource isolation between users, make sure your messages in the queue will not be illegally acquired.

D. Distributed Transaction message

Transaction complete messaging solution under the distributed environment.

E. support log management

Log management by the way, to see every message sent, received and deleted the full life cycle. Users can conveniently question survey conducted by log management.

F. Support Cloud Monitoring

The user can view the monitor queue where the cloud, and may be customized alarm item, when the queue does not meet a desired situation can be known in time.

Theme Model Introduction

Theme subscription model is designed to provide many of the publish-subscribe and message notification feature that allows users to achieve a variety of one-stop message notification method:

Pushed to the user specified HttpServer

Pushed to the user-specified Queue (the user can pull the message from Queue)

Push message (s)

Pushed to SMS (list)

WebSocket way to push (coming soon)

Mobile Push (Program Support)

Topic model characteristics

A. support notification messages

1) MNS server initiative to push a message to a user specified callback address (message notification address), the client program to eliminate unnecessary polling and resource consumption. The user can focus resources in their business logic. And also avoid dependence on other messaging client service products, the introduction of the code in order to avoid the excessive influence the stability of its own services.

2) Meanwhile, due to network or other causes inconvenient for the user to provide a callback address, MNS also supports push a message to the Queue, users can still get the message directly to the Queue. Previously used "queuing model" consumers, the theme of the message can be seamlessly consumption.

B. Support to-many broadcast messages

1) to publish a message topic can be simultaneously subscribe to multiple subscribers, will be pushed in the past in accordance with multiple subscriptions and manner specified push Endpoint address. Received from a plurality of users can simultaneously (species) channels to this message.

2) user only released once, the message may be pushed to a plurality of receiving terminal, to ensure the release of atomic message.

C. supports message filtering tag

On the basis of support-many broadcast messages on subscription also supports filter messages. Topic subscription message may be in with a specific label. When creating the subscription message specifies filter tag, label PublshMessage message and then specify when, MNS will be filtered based on the label at the push message, the push message filters only message label matches the label specified in the subscription to the specified Endpoint.

D. supports a variety of drop boxes

MNS supports multiple message delivery ways, including but not limited to:

Pushed Http (s) Server, see: HttpEndpoint processing, HttpEndpoint signature, HttpEndpoint Java, HttpEndpoint local Debug tool.

Queue pushed, see: Queue push, pull broadcast message.

Pushed to the mailbox, see: push email.

Pushed to SMS, see: SMS push.

Access WebSocket push (coming soon).

Access Mobile Push (Program Support).

E. message delivery guarantee

Within the message validity period, to ensure that the messages posted to the Topic will follow the format specified policy and pushed to the user program. Push strategies include:

Backoff retry (BACKOFF_RETRY)

Three retries, each retry time interval is a random value between 10 to 20 seconds

Retry exponential decay (EXPONENTIAL_DECAY_RETRY),

176 retries, each retry time interval index is incremented to 512 seconds, a total retry time is 1 day; specific for each retry intervals: 1, 2, 4, 8, 16, 32, 64, 128 , 256, 512, 512 ... 512 seconds (167 512)

Push message format comprising:

XML: XML format message body, the message body and message attributes comprising;

JSON: JSON format message body, the message body and message attributes comprising;

SIMPLIFIED (thin format, i.e. text format): message body i.e. the user release message does not contain any attribute information;

F. support cloud products you time notification

MNS provides event notification function, the user can create an event notification rules in the MNS, to pay attention to events occurring on other products designated Ali cloud resources, and by the way MNS message actively pushed to the designated receiver. OSS has access, the user can listen and handle OSS notification function in managing events by event Bucket, Bucket in Object create, delete, update events.

G. support log management

Log management by the way, look at each record a message into the theme of the release, and every once pushed to the user's records, including records retry push, push results, etc. Be able to show the life cycle of each message. Users can conveniently question survey conducted by log management.

H. Support Cloud Monitoring

Monitoring messages can be viewed through the cloud push recording, monitoring and timely view of a push message case, when the push failures relatively long time, by adding its timely alarm mode.

SMS capability

Messaging services along with the ability to communicate services, support quickly send SMS verification code, SMS notification, SMS promotion. Perfect support 200 million users during the double 11 to send 600 million text messages. Exclusive access to triple play, and the Ministry of LNP platform for real-time connectivity. Carrier-class operation and maintenance guarantee, constantly monitor automatically switches to reach the rate of 99%.

SMS notification and verification code

Large capacity and high concurrency: during double support 112 million users send SMS 600 million. 3 seconds up, exclusive access to triple play, and the Ministry of LNP platform for real-time connectivity. Variable flexible support into variable content flexible and can be adapted to support various business scenarios.

SMS promotion

SMS promotion supports a variety of content distribution, to help enhance product increased exposure. Business promotion, new product preaching, caring members like SMS.

Batch Transmission

To-many broadcast message, a message posted to the topic can be simultaneously subscribe to multiple subscribers, will be pushed in the past in accordance with multiple subscriptions and manner specified push Endpoint address.

Asynchronous Notification

When the back-end services can handle the task, the callback notifies the user. Further reduce the amount of unnecessary between the user, Web services front and rear ends of the polling request.

Statistics

You can view the amount requested, the amount sent successfully, the amount of failure, and other statistical data; dimension by date, phone number, etc., send details to see.

Ali cloud messaging services Tutorial: Ali Cloud University - developers classroom


Reproduced in: https: //juejin.im/post/5d0b51d75188257de35fdd61

Guess you like

Origin blog.csdn.net/weixin_34408624/article/details/93181618