Simple Message Queue (SMQ, formerly MNS) allows you to push the messages that are published to a topic to a queue. This topic describes how to push messages to a queue.
Step 1: Create a queue
Log on to the SMQ console.
In the left-side navigation pane, choose Queue Model > Queues.
In the top navigation bar, select a region.
On the Queues page, click Create Queue.
In the Create Queue panel, configure the following parameters and click OK:
Name: the name of the queue.
Maximum Message Length: the maximum length of a message that is sent to the queue.
Long Polling Period: the maximum duration for which long polling requests are held after the ReceiveMessage operation is called.
Visibility Timeout Period: the duration for which a message stays in the Inactive state after the message is received from the queue.
Message Retention Period: the maximum duration for which a message is retained in the queue. After the specified retention period ends, the message is deleted regardless of whether the message is received.
Scheduled Period: the period after which all messages sent to the queue are consumed.
Enable Logging Feature: specifies whether to enable the logging feature.
After the queue is created, the queue is displayed on the Queues page.
Step 2: Create a topic
In the left-side navigation pane, choose Topic Model > Topics.
On the Topics page, click Create Topic.
In the Create Topic panel, set the following parameters and click OK:
Name: the name of the topic.
Maximum Message Length: the maximum length of a message that is sent to the topic.
Enable Logging Feature: specifies whether to enable the logging feature.
After the topic is created, you are navigated to the Topic Details page of the topic.
Step 3: Create a subscription
In the left-side navigation pane, choose Topic Model > Subscriptions.
On the Subscriptions page, click Create Subscription.
In the Create Subscription panel, set the following parameters and click OK.
Topic Name: the name of the topic to which the subscription belongs.
Subscription Name: the name of the subscription.
Subscription: the type of the subscription. Select Queue.
Receiver Endpoint: the endpoint of the receiver. Select the queue that is created in Step 1.
Message Filtering Tag: optional. The tag that is used to filter messages.
Retry Policy: the retry policy.
Message Format: the format in which messages are pushed.
Step 4: Publish messages
On the Topics page, find the topic that you want to manage 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 content of the message.
Message Tag: optional. The tag that is used to filter messages.
Subscription Type: the type of the subscription. Select Queue.
Step 5: Receive messages
On the Queues page, find the queue that you want to manage and choose in the Action column.
(Optional) In the Receive Message section of the Quick Experience page, click Edit Parameters of Receiving Messages. In the Edit Parameters of Receiving Messages panel, configure the Receive Times and Polling Period parameters, and then click OK.
In the Receive Message section of the Quick Experience page, click Receive Message.
The received messages are displayed in the Receive Message section.
(Optional) Find a message in the message list and click Details in the Actions column. In the Message Details dialog box, view the information about the message, such as the message content.