Hello Sreekara Yachamaneni,
Thank you for posting your query here!
Adding on to the previous response, the ApproximateMessagesCount property of the QueueProperties class in Azure Storage Queues is indeed of type int. This means it can hold a maximum value of 2,147,483,647 (int.MaxValue), and it cannot be directly used to get the queue depth if it exceeds this value.
Unfortunately, Azure Storage Queues does not provide a built-in way to get the exact queue depth as a long or ulong.
Having more than 2 billion messages in a single queue is quite unusual and could indicate a need for a different architectural approach. For instance, partitioning the data across multiple queues.
Please note that Azure queues are designed to handle a large number of messages but having billions of messages in a queue could potentially lead to other issues, such as increased latency or difficulties in managing and processing the messages efficiently.
I hope this helps! Please let me know if the issue persists or if you have any other questions.
Please do not forget to "Accept the answer” and “up-vote” wherever the information provided helps you, this can be beneficial to other community members.