Getting Queue Statistics

Retrieve statistics about a queue, including its channels and dead letter queue.

You can use these values to scale up or down the number of consumers. Statistical data includes:

  • Visible messages: The approximate number of messages currently in a queue that are available for consumption.
  • In-flight messages: The approximate number of messages delivered to a consumer but not yet deleted. In-flight messages are unavailable for redelivery until their visibility timeout has passed.
  • Approximate size of the queue in bytes as the sum of the size of visible and in-flight messages.
Note

Statistical data is approximate because messages in a queue are constantly published, consumed, and deleted. Shortly after all producers and consumers have been stopped, the values become consistent.