Adding a Subscription

Scenarios

To deliver messages published to a topic to endpoints, you must add the subscription endpoints to the topic. Endpoints can be email addresses, phone numbers, functions, message queues, and HTTP/HTTPS URLs. After you add endpoints to the topic and the subscribers confirm the subscription, they are able to receive messages published to the topic.

You can add multiple subscriptions to each topic. This section describes how to add subscriptions to a topic you created or a topic to which you have been granted permissions and how to delete subscriptions.

To Add a Subscription

  1. Log in to the management console.
  2. Click on the upper left to select the desired region and project.
  3. Under Management & Governance, select Simple Message Notification.

    The SMN console is displayed.

  4. In the navigation pane, choose Topic Management > Subscriptions.
  5. In the upper right corner, click Add Subscription.

    The Add Subscription dialog box is displayed.

    Figure 1 Add Subscription
  6. Specify the required subscription information.
    1. Click beside the Topic Name box to select a topic.
    2. Specify the subscription protocol and endpoints.
      Table 1 Required subscription information

      Parameter

      Description

      Topic Name

      Name of the topic to be subscribed to

      Protocol

      Protocol the subscription endpoints support. The available options include SMS, Email, HTTP, FunctionGraph (function), DMS, and HTTPS.

      Endpoint

      Subscription endpoint. You can enter up to 10 SMS, application, Email, HTTP, or HTTPS endpoints, one in each line.

      • SMS: Enter one or more valid phone numbers.

        The phone number is preceded by a plus sign (+) and a country code. (The two can be deleted for a phone number in the Chinese mainland.)

        Example:

        +8600000000000

        +8600000000001

      • Email: Enter one or more valid email addresses.

        Example:

        username@example.com

        username2@example.com

      • HTTP: Enter one or more public network URLs.

        Example:

        http://example.com/notification/action

      • HTTPS: Enter one or more public network URLs.

        https://example.com/notification/action

      • FunctionGraph (function): Click to select a function and specify its version.
      • DMS: Click to select a message queue. Ensure that the queue policy grants the ProduceMessages permission to SMN. For details, see Managing Queue Policies in the Distributed Message Service User Guide.

        Only existing users who have used this protocol can select this protocol.

      • Application: If you select Application, enter one or more terminals running the platform application.

        Specify mobile devices by endpoint URN, which can be obtained from the Application Details page.

        Only existing users who have used this protocol can select this protocol.

  7. Click OK.

    The subscription you added is displayed in the subscription list.

    • To prevent malicious users from attacking subscription endpoints, SMN limits the number of confirmation messages that can be sent to an endpoint within a specified period of time. For details, see section "Traffic Control on Subscription Confirmation" in Simple Message Notification User Guide.
    • SMN does not check whether subscription endpoints exist when you add subscriptions. However, subscribers will not receive notification messages until they confirm their subscriptions.
    • After you add a subscription, SMN sends a confirmation message to the subscription endpoint. The message contains a link for confirming the subscription. The subscription confirmation link is valid within 48 hours. Confirm the subscription on your mobile phone, mailbox, or other endpoints in time.