All Products
Search
Document Center

ApsaraMQ for RabbitMQ:Query messages

Last Updated:Mar 15, 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. On the Message Query page, select Query by Queue from the Query Method drop-down list.

  5. Select the vhost and queue to which the message that you want to query belongs from the vhost and Queue drop-down lists, 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 message is routed if the routing key of the message matches the binding key of the queue that is bound to the exchange.

    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. On the Message Query page, select Query by Message ID from the Query Method drop-down list.

  5. Select the vhost and queue to which the message that you want to query belongs from the vhost and Queue drop-down lists, enter the message ID that was specified when the message was sent in the Message ID field, 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?