Publishing a Message
After you learn the basic concepts in SMN, you can start to create a topic, add subscriptions to the topic, and publish messages on the SMN console.
Scenarios
To send similar messages repeatedly, create a message template which contains fixed and changeable content. Every time you send messages using the template, you only have to replace changeable content. For example, your organization holds expositions regularly and needs to notify relevant people of the time, you can create a message template containing date variables and other fixed content.
Step 1. Create a Topic
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Select Simple Message Notification under Application.
The SMN console is displayed.
-
In the navigation pane, choose Topics.
The Topics page is displayed.
- In the upper right corner, click Create Topic.
- Enter a topic name and display name.
Table 1 Parameter descriptions Parameter
Description
Topic Name
Topic name, which:
- Contains only letters, digits, hyphens (-), and underscores (_), and must start with a letter or digit.
- Contains 1 to 255 characters.
- Must be unique and cannot be modified once the topic is created.
Display Name
Message sender name which can contain up to 192 characters
NOTE:After you specify a display name, the sender in email messages will be presented as Display name<username@example.com>. Otherwise, the sender will be username@example.com.
Enterprise Project
Centrally manages cloud resources and members by project.
Tag
A tag is a key-value pair. Tags identify cloud resources so that you can easily categorize and search for your resources.
- A key can contain up to 36 characters. A value can contain up to 43 characters. Both Key and Value can contain only digits, letters, hyphens (-), and underscores (_).
- Click OK.
The topic you created is displayed in the topic list. The system generates a topic URN, which is the unique resource identifier of the topic and cannot be changed.
- Click the name of the topic to view its details, including the topic URN, display name and subscriptions.
Step 2. Add a Subscription
- Log in to the management console.
- In the upper left corner of the page, click and select the desired region and project.
- Select Simple Message Notification under Application.
The SMN console is displayed.
- In the upper right corner, click Add Subscription.
The Add Subscription dialog box is displayed.
- Specify the required subscription information.
- Beside the Topic Name box, click Select Topic.
- Specify the subscription protocol and endpoints.
Table 2 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 include HTTP, HTTPS, and Email.
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
- Email: Enter one or more valid email addresses.
- 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. 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 your subscription endpoint. You can confirm the subscription within 48 hours through the confirmation link via your mobile phone, mailbox, or other endpoints.
- Subscription confirmation messages will be counted as messages sent and will be billed.
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot