If you have questions about the messages that are sent to Message Queue for RabbitMQ, you can query the messages in the Message Queue for RabbitMQ console.

Background information

Message Queue for RabbitMQ provides the following query methods:
  • Query messages by queue: This method is 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.
  • Query messages by message ID: This method is used in exact search scenarios in which you have obtained the message IDs that are specified when messages are sent. For more information, see How do I specify a message ID?.

Limits

  • Message Queue for RabbitMQ allows you to query messages within a maximum of three days.
  • Message Queue for RabbitMQ allows you to query a maximum of 100 messages at a time.

Query messages by queue

  1. Log on to the Message Queue for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. In the top navigation bar of the Instances page, select a region. 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 of the queue whose messages you want to query from the Vhost drop-down list, select the queue from the Queue drop-down list, configure the Time Range parameter, and then click Query.
    pg_query_by_queue
    Parameter Description
    ExchangeName The name of the exchange that sends the message. The exchange is bound to the queue whose messages you want to query.
    RoutingKey The routing key specified when the message is 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 ID of the message. 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 a maximum of 64 messages with the same message ID.
    StoreTime The point in time when the message is stored in a queue after it is sent to the queue.

Query messages by message ID

  1. Log on to the Message Queue for RabbitMQ console. In the left-side navigation pane, select Instances.
  2. In the top navigation bar of the Instances page, select a region. 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 of the queue whose messages you want to query from the Vhost drop-down list, select the queue from the Queue drop-down list, enter the message ID that is specified when the message is sent in the Message ID field, configure the Time Range parameter, and then click Query.

What to do next

  • Download a message

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

  • Resend a message
    1. Among the queried messages, find the message that you want to resend and click Resend in the Actions column.
    2. Read the Note message that appears and click OK.