All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Query messages

Last Updated:Jul 02, 2024

If you have questions about messages that are sent to ApsaraMQ for RabbitMQ, you can query the messages in the ApsaraMQ for RabbitMQ console. ApsaraMQ for RabbitMQ allows you to query messages by queue and by message ID. The query by queue method can be used in fuzzy search scenarios in which you have obtained the queue to which messages are sent but not the message IDs that are specified when messages are sent. The query by message ID method can be used in exact search scenarios in which you have obtained the message IDs that are specified when messages are sent.

Limits

  • ApsaraMQ for RabbitMQ allows you to query messages that are sent in the previous three days.

  • ApsaraMQ for RabbitMQ allows you to query up to 100 messages at a time.

Query messages by queue

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, in the instance list, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Message Query.

  4. In the upper-left corner of the Message Query page, click Change, select the vhost to which the message that you want to query belongs, and then click the Query by Queue tab.

  5. In the Queue drop-down list, select the queue to which the message that you want to query belongs, configure the Time Range parameter, and then click Query.

    pg_query_by_queue

    Parameter

    Description

    ExchangeName

    The name of the exchange that sent the message. The exchange is bound to the queue to which the message that you want to query belongs.

    RoutingKey

    The routing key specified when the message was sent. The exchange routes the message to the queue based on the routing key.

    MessageID

    The message ID. In most cases, a message ID is a business-specific attribute that is globally unique. If a message ID is not globally unique, you can find up to 64 messages with the same message ID in the query result.

    StoreTime

    The point in time when the message was stored to a queue after it was sent to the queue.

Query messages by message ID

  1. Log on to the ApsaraMQ for RabbitMQ console. In the left-side navigation pane, click Instances.

  2. In the top navigation bar of the Instances page, select the region where the instance that you want to manage resides. Then, in the instance list, click the name of the instance that you want to manage.

  3. In the left-side navigation pane, click Message Query.

  4. In the upper-left corner of the Message Query page, click Change, select the vhost to which the message that you want to query belongs, and then click the Query by Message ID tab.

  5. In the Queue drop-down list, select the queue to which the message that you want to query belongs. In the Message ID field, enter the message ID that you specified when you sent the message, configure the time range parameter, and then click Query.

What to do next

  • Download a message

    Among the returned messages, find the message that you want to download and choose More > Download Message in the Actions column.

  • Resend a message

    1. Among the returned messages, find the message that you want to resend and click Resend in the Actions column.

    2. In the Note message, click OK.

References

For information about how to specify message IDs, see How do I specify a message ID?