edit-icon download-icon

Overview

Last Updated: Sep 25, 2017

Alibaba Cloud Message Service is a high performance, reliable, safe, extensible distributed message and notification service that supports massive messages, concurrent operations. It help facilitate message transfer between applications and system decoupling.

Message Service provides 2 models:

  • Queue

    Designed to send or receive messages in Point-to-Point way. The consumer receives a message by pulling it down.

  • Topic

    Designed to send or receive the message in Pub/Sub way. The message is pushed from message broker to consumers. The consumers can be HTTP, queue, SMS, e-mail, or mobile phone.

Queue Model Overview

Queue is designed to provide consuming message in a point-to-point way for highly concurrent scenarios. Each message can be consumed only once.

Queue Model Illustration

queue model

Characteristics of Queue model

A. Multiple attributes

The queue model supports a variety of customizable attributes to meet the requirements of different scenarios, such as normal queue, delayed queue, priority queue.

B. Support massive request concurrently

One queue can be accessed by many producers or consumers at the same time while one message can not be fetched by other consumers within a certain period of time after being fetched by one consumer.

C. Ensurance for message delivery

The message which is sent to the queue successfully is guaranteed to be fetched at least once and prevent the illegal access from others.

D. Support transaction message

It provides function to rollback the message sent to the queue, which helps applications to perform transaction rollback.

E. Support logging for operations on message

It provides log function to query the operations of sending, receiving and deleting on messages. It’s helpful while debugging.

F. Support Alibaba Cloud Watch

You can get queue information from CloudWatch and customize alerts.

Topic Model Overview

Topic model is designed to provide message publishing, subscription, and notification from one publisher to multiple subscribers. It supports several ways for message notification:

  • Push the message to HTTP server specified by user.
  • Push the message to an MNS queue.
  • Push the message to an e-mail address or e-mail address group.
  • Push the message to browsers via WebSocket(in planning).
  • Push the message to mobile devices.

Topic Illustration

Topic Subscription Model Illustration

Characteristics of Topic Model

  • Support notification messages.
  • Support one-to-multiple messages.
  • Support tag filtering for messages.
  • Support different ways to push messages.
  • Ensurance for message delivery.
  • Support for event messages from Alibaba Cloud services.
  • Support log management.
  • Support Alibaba Cloud Watch.
A. Support notification of messages
  • Message Service server pushes messages to the HTTP URL which is specified by the users. In this way, the applications of users do not need to handle the message broker server any more, which helps users save resource such as CPU, and reduce dependency on the Message Service SDK.

  • Message service server pushes messages from topic to queue when users are inconvenient to provide the HTTP URL due to the network problem, which enables applications consume messages from queue in time.

B. Support one-to-multiple message.

A message sent to topic can be subscribed by multiple consumers and pushed to mutiple endpoints in the way designated by consumers.

C. Support filter tag for message

Tag(at most of time , it’s a string) can be specified while doing subscription of topics for endpoints. Tag can also be defined as an attribute of the message while publishing. Topic only sends the message to the endpoint with the same tag(string). If the endpoint does not specify which tag to subscribe, it will receive all of the messages published to the topic. Messages without tags will be sent to all the endpoints.

D. Support different ways to push message

Support the following ways:

E. Ensurance for message delivery

Messages are pushed in the strategy and format specified by users.
Push strategies include the following:

  • BACKOFF_RETRY: Retry 3 times in total (with the interval of 10 to 20 seconds) for each message.
  • EXPONENTIAL_DECAY_RETRY: Retry 176 times in total for each message. The intervals between adjecent retries are sequential as following order: 1, 2, 4, 8 , 16, 32, 64, 128, 256, 512, 512, 512… The maximum time interval is 512 seconds.

Message formats include the following:

  • XML:Message body is in XML format with message attributes;
  • JSON:Message body is in JSON format with message attributes;
  • SIMPLIFIED:message body is raw text.

F. Support for event message from Alibaba Cloud services.

Message service provides event/notification function, so that other Alibaba Cloud Services such as OSS(Object Storage Service), DM(DirectMail) Service, SLS(Simple Log Service) etc. can subscribe event from the cloud resources. This function enables users to set rules for the event operations on OSS object including: CreateObject, DeleteObject, UpdateObject etc.

G. Support logging for operations on message.

Every operation on message is logged down to the SLS or OSS. Users can query the message log with message id in SLS.

H. Support Alibaba Cloud Watch.

Users can get topic information from CloudWatch and customize alerts.

Thank you! We've received your feedback.