How to check the size of a message-queue

Abhishek Member Posts: 8
edited February 2022 in General Discussions #1

I have a specific requirement.
When we start/restart the pub, we need to check the size of the last value queue. It should be zero in the start of the day, and it should be 1 during the day ( at least one message went through).
When the LVQ size is zero, we will consider it the start of the day ( no message went through).
and When the LVQ size is one, we will consider it during-day ( atleast one message went through)

What is the API or any other way to check the queue size. Please share sample code if any available?