This topic describes how to manage topics in the Message Service (MNS) console.
Prerequisites
MNS is activated, and a Resource Access Management (RAM) user is authorized to access MNS. For more information, see Activate MNS and authorize RAM users to access MNS.
Create a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, click Create Topic.
In the Create Topic panel, configure the following parameters and click OK.
Name: the name of the topic.
Maximum Message Length: the maximum body length of the message that is sent to the topic.
Enable Logging Feature: specifies whether to enable the logging feature.
After you create the topic, you are redirected to the Topic Details page of the topic.
Edit a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to modify and click Edit in the Actions column.
In the Edit Parameter of Topic panel, modify the topic settings and click OK.
In the Basic Information section of the Topic Details page, you can view the modified settings of the topic.
Search for topics
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
In the top search box of the Topics page, enter the prefix of the topic name, such as test, and click the search icon.
All the topics whose names are prefixed with test are displayed on the Topics page.
View the details of a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to view and click Details in the Actions column.
On the Topic Details page, view the details of the topic.
View the endpoints of a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to view and click Details in the Actions column.
In the Endpoint section of the Topic Details page, view the endpoints that are used to access the topic over the Internet and internal network.
NoteYou can send HTTP or HTTPS requests to access the endpoints.
View the monitoring metrics of a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to view and choose in the Actions column.
In the Cloud Monitor section of the Topic Details page, view the monitoring metrics of the topic.
NoteFor more information about alert rules, see Create an alert rule.
Delete a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to delete and choose in the Actions column.
In the Note message, read the note and click OK.
The topic is deleted from the Topics page.
WarningAfter a topic is deleted, you cannot restore the data of the topic.
Create a subscription
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic. Click View Subscriptions in the Actions column.
In the View Subscriptions to Topic panel, click Subscriptions.
On the Manage Subscriptions page, click Create Subscription.
In the Create Subscription panel, set the following parameters and click OK.
Name: the name of the subscription.
Push Type: the type of the subscription. In this example, set the value to Queue.
Receiver Endpoint: the endpoint of the receiver.
(Optional) Message Filtering Tag: the tag that is used to filter messages.
Retry Policy: the retry policy that is applied if an error occurs during message delivery from an MNS topic to the receiver.
The Retry Policy parameter can be set to one of the following values:
Backoff Retry
Exponential Decay Retry
Message Pushing Format: the format of the message that is pushed to the receiver.
The Message Pushing Format parameter can be set to one of the following values:
SIMPLIFIED
JSON
XML
The subscription appears on the Manage Subscriptions page.
Edit a subscription
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to manage and click the topic name.
In the left-side navigation pane, click Manage Subscriptions. On the Manage Subscriptions page, find the subscription that you want to modify and click Modify Retry Policy in the Actions column.
In the Edit Parameter of Subscription panel, modify the retry policy and click OK.
Search for subscriptions to a topic
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to view and click View Subscriptions in the Actions column.
In the View Subscriptions to Topic panel, enter the prefix of the subscription name in the top search box, such as test, and click the search icon.
All the subscriptions whose names are prefixed with test are displayed.
Delete a subscription
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
On the Topics page, find the topic that you want to manage and click the topic name.
In the left-side navigation pane, click Manage Subscriptions. On the Manage Subscriptions page, find the subscription that you want to delete and click Delete in the Actions column.
In the Note message, read the note and click OK.
The subscription is deleted from the Manage Subscriptions page.
Publish a message
Log on to the MNS console.
In the left-side navigation pane, click Topics.
In the top navigation bar, select a region.
- On the Topics page, find the topic to which you want to publish a message. Choose in the Actions column.
- On the Try Publishing Message to Topic page, set the following parameters and click Publish Message.
- Message Content: The body of the message to be published.
- Optional:Message Tag: the tag used to filter messages.
- Subscription Type: the subscription type of pushing a message to the topic.
"The message is sent" appears on the page.