Method for retrieving outstanding events for Channels or durable subscribers

I believe the method “getChannelLength” is not the correct one to use to get the number of total outstanding events. Does anyone the correct method to use?

Correction. I mean “getEventCount()” doesn’t appear to give the the outstanding events.

Ignore my mentioned “getChannelLength”.

It depends what count you are looking for, a durable and a channel can have different numbers especially if its 9.12 and before where shared durable used a separate store.

The API you mention will tell you how many events are sitting on the channel

If you want to know how many events a shared durable has in 9.12+

If its not shared then you will need to deduce it from a couple of API’s using the below two API’s which is basically nChannel.getLastEID - nDurable.getEID

Thanks Joshua. What I’m looking for is to get a report of the number of pending messages waiting to be processed or any queues or channel/durable subscribers. We experienced a situation where there were thousands of messages waiting to be processed and once it was cleared, our report still show thousands of messages or events for that specific queue. I was using the “getEventCount()”.

Thanks for the reference Joshua. I believe below is the method that will give me the number I’m seeking.


No problems, let me know if you need any more assistance with this.