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 where you obtain the queue to which messages are sent, but do not obtain the message IDs that are specified when messages are sent.
  • Query messages by message ID: This method is used in exact search scenarios where you obtain the message IDs that are specified when messages are sent. For information about how to specify a message ID, see How do I specify a message ID?.

Limits

  • Message Queue for RabbitMQ allows you to query the 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.
  2. In the Resource Distribution section of the Overview page, select the region where your instance is located.
  3. On the Instances page, click the name of your instance.
  4. In the left-side navigation pane, click Message Query.
  5. On the Message Query page, select Query by Queue from the Query Method drop-down list.
  6. Select the vhost whose messages you want to query from the Vhost drop-down list, select the queue whose messages you want to query from the Queue drop-down list, specify Time Range, and then click Query.
    pg_query_by_queue
    Parameter Description
    ExchangeName The name of the exchange that sends a specific message. The exchange is bound with the queried queue.
    RoutingKey The routing key specified when a message is sent. The message is routed based on the matching relationship between the routing key of the message and the binding key of the queue that is bound to the exchange.
    MessageID The message ID. In most cases, it is a business-specific attribute and globally unique. If it is not globally unique, you can find a maximum of 64 messages with the same message ID.
    StoreTime The time when a 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.
  2. In the Resource Distribution section of the Overview page, select the region where your instance is located.
  3. On the Instances page, click the name of your instance.
  4. In the left-side navigation pane, click Message Query.
  5. On the Message Query page, select Query by Message ID from the Query Method drop-down list.
  6. Select the vhost whose messages you want to query from the Vhost drop-down list, select the queue whose messages you want to query from the Queue drop-down list, enter the message ID that is specified when the message is sent in the Message ID field, and then click Query.

What to do next

  • Download a message

    Among the queried messages, find the message that you want to download, click More in the Actions column, and then select Download Message.

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