All Products
Search
Document Center

Simple Message Queue (formerly MNS):Queue operations

Last Updated:Mar 17, 2025

This topic describes operations related to the queue-based messaging model that you can perform within the Simple Message Queue (formerly MNS) console.

Prerequisites

Enable Simple Message Queue (formerly MNS) and grant permissions.

Create a queue

  1. Log on to the SMQ console.

  2. In the left-side navigation pane, choose Queue Model > Queues.

  3. In the top navigation bar, select a region.

  4. On the Queues page, click Create Queue.

  5. In the Create Queue panel, configure the following parameters, and then click OK.

    • Name: the name of the queue.

    • Maximum Message Length: the maximum length of the 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. The value 0 indicates that long polling is disabled.

    • Visibility Timeout Period: the duration for which a message stays in the Inactive state after the message is received from the queue. For more information, see Message visibility.

    • Message Retention Period: the maximum duration for which a message exists in the queue. After the specified retention period, the message is deleted regardless of whether the message is received.

    • Message Delay Period: the period after which all messages sent to the queue are consumed.

    • Enable Logging Feature: specifies whether to enable the logging feature. If this feature is enabled, SMQ automatically pushes the operation logs of this queue to the specified Logstore. You can then view the message trace, delay, and other information from the logs. For more information, see Log management.

    The Queues page confirms the creation of the target queue.

Modify a queue

  1. On the Queues page, locate the desired queue. In the Operation column on the right, click on More > Edit.

  2. In the Edit Queue Parameters panel, modify the queue configuration, and then click Confirm.

    On the Queue Details page, you can view the updated queue configuration in the Basic Information area.

Obtain a queue list

  1. On the Queues page, enter a queue name prefix, such as 'test', into the search text box and then click the search icon.

    The query list will display all queues with the prefix test.

Obtain queue details

  1. On the Queues page, locate the desired queue. In the Operation column on the right, click Details.

  2. On the Queue Details page, you can view detailed information about the queue.

Obtain endpoints

  1. In the Queues, locate the desired queue. In the Operation column on the right, click Details.

  2. On the Queue Details page, you can view the Endpoint section to verify the Endpoint for Internet Access and Internal Access.

    Note

    The Endpoint address supports both HTTP and HTTPS access methods.

Send messages

  1. On the Queues page, locate the desired queue. In the Action column on the right, click More > Send Messages.

  2. On the Queue Send/receive Messages Quick Experience page, within the Send Message section, input the Message Content and Message Delay Period, then click Send Message.

    "The message is sent" appears on the page.

Receive messages

  1. On the Queues page, locate the desired queue. In the Action column on the right, click More > Send Messages.

  2. Optional:In the Queue Send/receive Messages Quick Experience page, in the Receive Message area, click Edit Parameters of Receiving Messages, configure Edit Parameters of Receiving Messages panel, configure Receive Times and Polling Period, and then click Confirm.

  3. On the Queue Send/Receive Messages Quick Experience page, within the Receive Message section, click Receive Message.

    The Receive Messages area shows the queue's message list.

  4. Optional: To view a specific message, locate it in the message list. In the Operation column on the right, click Details to access the message content and additional information in the Message Details dialog box.

View queue metrics

  1. In the Queues, locate the desired queue. In the Operation column on the right, click More > Cloud Monitor.

  2. In the Cloud Monitor area, you can view the queue's metrics.

    image

    Note

    For more information about alert rules, see Create alert rules.

Delete a resource queue

  1. In the Queues, locate the desired queue. On the right, in the Operation column, click on More > Delete.

  2. In the Prompt dialog box, read the information provided, and then click Confirm.

    On the Queues page, ensure that the target queue has been deleted.

    Warning
    • Once a queue is deleted, data cannot be recovered.

    • Before you delete a queue, ensure that you stop sending API requests to it. Otherwise, the API requests will still incur fees.