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 by queue: This method is used in fuzzy search scenarios in which you obtain the queue to which messages are sent, but do not obtain the message IDs that are specified when messages are sent.
  • Query by message ID: This method is used in exact query scenarios in which 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 of a maximum of three days.
  • Message Queue for RabbitMQ allows you to query a maximum of 100 messages.

Query by queue

  1. Log on to the Message Queue for RabbitMQ console.
  2. In the top navigation bar, select the region where your instance resides.
  3. In the left-side navigation pane, click Message Query.
  4. On the Message Query page, select an instance and a vhost and click the Query by Queue tab.
  5. On the Query by Queue tab, select the required queue, specify a time range, and then click Search.
    pg_query_by_queue
    Parameter Description
    Exchange Name The name of the exchange that sends a specific message. The exchange is bound with the required queue.
    Routing Key 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 an exchange.
    Message ID The message ID. In most cases, it is a globally unique message attribute related to the business. If it is not globally unique, you can find a maximum of 64 messages with the same message ID.
    Stored At The time when a message is sent to a queue.

Query by message ID

  1. Log on to the Message Queue for RabbitMQ console.
  2. In the top navigation bar, select the region where your instance resides.
  3. In the left-side navigation pane, click Message Query.
  4. On the Message Query page, select an instance and a vhost and click the Query by Message ID tab.
  5. On the Query by Message ID tab, select the required queue, enter the message ID specified when a message is sent, specify a time range, and then click Search.
    pg_query_by_messageid
    Parameter Description
    Exchange Name The name of the exchange that sends a specific message. The exchange is bound with the required queue.
    Routing Key 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 an exchange.
    Message ID The message ID. In most cases, it is a globally unique message attribute related to the business. If it is not globally unique, you can find a maximum of 64 messages with the same message ID.
    Stored At The time when a message is sent to a queue.

What to do next

  • Download a message

    Find the required message and click Download in the Actions column.

  • Resend a message
    1. Find the required message and click Resend in the Actions column.
    2. In the Confirmation message, click OK.