You can create, edit, find, and delete topics and subscriptions in the Simple Message Queue (SMQ) console.
Prerequisites
Create a topic
Log on to the SMQ console.
In the left-side navigation pane, choose Topic Model > 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 length of the message that is sent to the topic.
Enable Logging Feature: specifies whether to enable the logging feature. If this feature is enabled, SMQ automatically pushes the operation logs of this topic to the specified Logstore. You can then view the message trace, delay, and other information from the logs. For more information, see Log management.
You are redirected to the topic's Topic Details page.
Edit a topic
-
On the Topics page, find the target topic and click Edit in the Actions column.
-
In the Edit Topic Parameter panel, modify the topic configuration and click OK.
The updated topic configuration appears in the Basic Information section of the Topic Details page.
Find topics
-
On the Topics page, enter a prefix of the topic name, such as
test, in the search box and then click the
icon.The list displays all topics with names that start with
test.
View topic details
-
On the Topics page, find the target topic and click Details in the Actions column.
-
The Topic Details page displays detailed information about the topic.
Get endpoints
-
On the Topics page, find the target topic and click Details in the Actions column.
-
On the Topic Details page, in the Endpoint section, find the endpoints for Internet Access and Internal Access.
NoteEndpoints support both HTTP and HTTPS access.
Create a subscription
Log on to the SMQ console.
In the top navigation bar, select a region.
-
In the left-side navigation pane, choose .
-
On the Subscriptions page, click Create Subscription.
-
In the Create Subscription panel, configure the following parameters and click OK.
-
Topic Name: Select the topic to which this subscription belongs.
-
Subscription Name: The name of the subscription. It must start with a letter, can contain letters, digits, and hyphens (-), and must not exceed 255 characters.
-
Subscription: The push type of the subscription. The default value is HTTP. For more information, see Subscription types.
-
Receiver Endpoint: The receiver's endpoint address.
-
Optional: Message Filtering Tag: A tag for message filtering.
-
Retry Policy: The retry policy when a message push fails to reach the endpoint.
The following retry policies are available:
-
BACKOFF_RETRY: Retries three times at random intervals of 10 to 20 seconds.
-
DECAY_RETRY: Retries 176 times. The retry interval increases exponentially to 512 seconds, for a total retry duration of one day. The specific retry intervals are: 1, 2, 4, 8, 16, 32, 64, 128, 256, 512, 512, ..., 512 (a total of 167 retries at 512-second intervals).
-
-
Message Format: The format of messages pushed to the endpoint.
-
SIMPLIFIED: The message body contains only the user-published content, without any attributes. Example:
{1:"a", 2:"b"} -
JSON: The message body is in JSON format and contains both the message content and its attributes. Example:
{ "TopicOwner":"TopicOwner", "TopicName":"TopicName", "Subscriber":"Subscriber", "SubscriptionName":"SubscriptionName", "MessageId":"6CC4D900CA59A2CD-1-15180534A8F-20000****", "Message":"xxxxx", "MessageMD5":"F1E92841751D795AB325861034B5****", "MessageTag":"important", "PublishTime":"1449556920975" } -
XML: The message body is in XML format and contains both the message content and its attributes. Example:
<?xml version="1.0" encoding="utf-8"?> <Notification xlmns="http://mns.aliyuncs.com/doc/v1/"> <TopicOwner>TopicOwner</TopicOwner> <TopicName>TopicName</TopicName> <Subscriber>Subscriber</Subscriber> <SubscriptionName>SubscriptionName</SubscriptionName> <MessageId>6CC4D900CA59A2CD-1-15180534A8F-20000****</MessageId> <Message>{1:"a", 2:"b"}</Message> <MessageMD5>F1E92841751D795AB325861034B5****</MessageMD5> <MessageTag>important</MessageTag> <PublishTime>1449556920975</MessagePublishTime> </Notification>
-
The new subscription appears on the Subscriptions page.
-
Edit a subscription
-
On the Subscriptions page, find the target subscription and click Edit in the Actions column.
-
In the Edit Subscription Parameter panel, modify the retry policy and click OK.
Find subscriptions
-
On the Subscriptions page, enter a prefix of the subscription name, such as
test, in the search box and then click the
icon.The list displays all subscriptions with names that start with
test.
Publish a message
-
On the Topics page, find the target topic and click Publish Message in the Actions column.
-
On the Try Publishing Message to Topic page, configure the following parameters and click Publish Message.
-
Message Content: The message body.
-
(Optional) Message Tag: A tag for message filtering.
-
Subscription Type: The subscription type to which the message is pushed. For more information, see Subscription types.
A "Message sent successfully" notification appears on the page.
-
View topic metrics
-
On the Topics page, find the target topic, and in the Actions column, choose .
-
In the Cloud Monitor section on the Topic Details page, you can view the monitoring metrics for the topic.
NoteFor more information about alert rules, see Create an alert rule.
Delete a subscription
-
On the Subscriptions page, find the target subscription. In the Actions column, click Delete.
-
In the Prompt dialog box, read the message and click OK.
The subscription is removed from the Subscriptions page.
Delete a topic
-
On the Topics page, find the target topic, and in the Actions column, choose .
-
In the Prompt dialog box, read the message and click OK.
The topic is removed from the Topics page.
WarningAfter a topic is deleted, its data cannot be recovered.