edit-icon download-icon

Message accumulation query

Last Updated: Aug 31, 2018

This topic explains how to use Open API to query the MQ message status in the running process, including the message sending status, message consumption status, the presence of accumulated messages, how to handle accumulation, and so on.

Query method

  1. To view the Topic message sending status: view the total number of valid messages, and the latest status of the messages of the target Topic on the current server.

  2. To view the consumption progress of the Consumer ID: view if the consumption of the specified Consumer ID is accumulated.

  3. Client consumption status query: if the client consumption is accumulated, view the connection status of clients in the consumption group, and determine if consumer threads of the client are blocked.

  4. Consumer offset resetting: update the consumption progress offset of the consumer according to business requirements. This function includes two scenarios.

    • Scenario A: clear all messages if they can be discarded.
    • Scenario B: reset the offset according to the specified time if the accumulated messages need to be recycled or updated to a specified time.

Main process

The calling process is shown in the following figure:

msg accumulation

  • Current message query: OnsTopicStatus
  • Consumption progress query: OnsConsumerAccumulate
  • Consumer status query: OnsConsumerStatus
  • Clear accumulation: OnsConsumerResetOffset
Thank you! We've received your feedback.