Advanced
Тема интерфейса

Adding a Subscription to a Topic

Эта статья полезна?
Язык статьи: Английский
Перевести

Scenarios

To deliver messages published to a topic to endpoints, you must add the subscription endpoints to the topic.

Adding a Subscription

  1. Log in to the management console.
  2. In the upper left corner of the page, click and select the desired region and project.
  3. Select Application > Simple Message Notification.

    The SMN console is displayed.

  4. In the navigation pane on the left, choose Topic Management > Topics.

    The Topics page is displayed.

  5. Locate the topic that you want to add a subscription to. In the Operation column, click Add Subscription.

    Alternatively, click a topic name. In the upper right corner of the displayed page, click Add Subscription.

    The Add Subscription dialog box is displayed.

    Figure 1 Add Subscription


  6. Specify the subscription protocol and endpoints.
    Table 1 Parameters for adding a subscription

    Parameter

    Description

    Topic Name

    Specifies the name of the topic to which messages are published.

    Protocol

    Specifies the protocol over which messages are sent. Possible values are FunctionGraph (function), Email, HTTP, and HTTPS.

    Method

    The following two options are available:

    • Add subscriptions
    • Import subscriptions: Select subscribers whose subscription has been confirmed and import the subscription data. After the subscription is imported, information such as the subscription endpoint and subscription status is synchronized. Only email, HTTP, and HTTPS subscriptions can be imported.

    Endpoint

    Specifies the subscription endpoint. You can add up to 10 email, HTTP, or HTTPS endpoints, one in each line.

    • Email: Enter one or more valid email addresses.

      Examples:

      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.

      Example:

      https://example.com/notification/action

    • FunctionGraph (function): Click to select a function and specify its version.

    Request Header

    This parameter is only available if HTTP or HTTPS is selected for Protocol. It indicates whether to configure the request header now. If you select Configure now, specify Key and Value. You can add up to 10 request headers.

    The value of Key must:

    • Be case insensitive and unique.
    • Start with x- but cannot start with x-smn.
    • Contain only digits, letters, and hyphens (-), but not end with a hyphen nor contain consecutive hyphens.

    Version

    This parameter is only available if FunctionGraph (function) is selected for Protocol. Select the version for the function.

    Description

    Specifies the remarks of the subscription.

    To modify the subscription remarks, click in the Description column of the target subscription in the subscription list.

  7. Click OK.

    The subscription you added is displayed in the subscription list.

    Note
    • 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. For details, see Traffic Control over Subscription Confirmation.
    • SMN does not check whether subscription endpoints exist when you add subscriptions.
    • After you add a subscription or request subscription confirmation, SMN will send a confirmation message to the endpoints, and the link in the confirmation message will be valid for 48 hours.
    • Subscription confirmation messages will be counted as messages sent and will be billed.