SNS
The Simple Notification System (SNS) is composed of three major parts: topic, application platform, and application endpoint.
- Topic: a logical access point that acts as a communication channel to receive messages. For example, ZWatch can send alarm messages to a topic, and then the topic distributes the messages to the corresponding subscribed endpoints.
- Application platform: the platform through which messages are sent to specific endpoints. For example, an email server is needed if you want to send messages to an email endpoint. The email server mentioned above is an application platform. Currently, two platforms are available: email server and system platform. The system platform is used to send messages to endpoints that do not need a platform, such as DingTalk and HTTP webhook.
- Application endpoint: the endpoint used to receive messages. Currently, the following application endpoints are available: system endpoint, email, DingTalk, HTTP application, and short message service, and Microsoft Service. Before an endpoint can receive messages from a topic, the endpoint must be subscribed to the topic.
Topic has a many-to-many relationship with endpoint. That is, a topic can be subscribed by multiple endpoints, and an endpoint can also subscribe to multiple topics.
When an external system (such as ZWatch) sends a message to a topic, the topic will find all the endpoints that subscribed to the topic, and then send the message through the platform to which the endpoints belong. Assume that you subscribed an email endpoint (an email address) to a topic. When the topic receives an alarm message, it will send an alarm email to the endpoint represented by the email address through the platform (an email server) to which the email endpoint belongs.
Basic Workflow
The basic workflow of SNS is as follows:
- Create an SNS topic to receive alarm messages from external systems such as ZWatch.
- Create an application platform (an email server) if you use the email endpoint.
- Create an endpoint and subscribe the endpoint to the SNS topic you created in Step 1.
