will active message count ever be zero, when publishing and consumption match in Azure Service Bus queues?

Lakshmi Kanthan M 26 Reputation points
2020-08-05T13:22:40.67+00:00

Hello everyone,

15846-active-message-count.png

We have a data transfer solution with Azure Service Bus as the message broker. if you see the message publishing/ consumption pattern above, it looks like the messages are consumed as soon as they are published, i.e., the count of outgoing messages pretty much overlaps the count of incoming messages. however, we see that the active message count (Average) is not zero - it looks like there is an accumulation of messages (upto 2 or 4), and then they are consumed. we see alternating peeks and valleys in the active messages chart.

We have the following questions -

  • How is the active messages count calculated by Azure and reported on the Metrics chart?
  • Is the Java QueueClient not consuming the messages as and when they are published? is there a delay in consumption, leading to the building up of active messages in our queues?

Environment details:

  • Java - openjdk-11-jre
  • Azure Service Bus namespace tier: Standard
  • Java SDK version - 3.4.0
  • number of queues - 43 with one producer and one consumer QueueClient per queue
Azure Service Bus
Azure Service Bus
An Azure service that provides cloud messaging as a service and hybrid integration.
594 questions
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. svijay-MSFT 5,226 Reputation points Microsoft Employee
    2020-08-06T10:53:59.043+00:00

    Values for the Active Messages Count metrics are point-in-time values - meaning it checks for the active messages that is not yet consumed by the consumer at that specific instant of time.

    If you look closely, there is a slight deviation from the incoming and outgoing messages at that point of time.

    16108-image.png

    There are times the messages incoming rate is very slightly more than the message processing rate - right from connecting to Service bus to processing the message complete. Also, if the processing of the message had not happened correctly, it would still remain active until retried.