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 https://techcommunity.softwareag.com/ecosystem/documentation/onlinehelp/Rohan/num10-3/10-3_UM_webhelp/um-webhelp/Doc/java/classcom_1_1pcbsys_1_1nirvana_1_1client_1_1n_channel.html#a3c4bbf170b280691d0a21948caf482bd

If you want to know how many events a shared durable has in 9.12+ https://techcommunity.softwareag.com/ecosystem/documentation/onlinehelp/Rohan/num10-3/10-3_UM_webhelp/um-webhelp/Doc/java/classcom_1_1pcbsys_1_1nirvana_1_1client_1_1n_named_object.html#a1ceafd9599ebbd6047ca7e029c2e9594

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

https://techcommunity.softwareag.com/ecosystem/documentation/onlinehelp/Rohan/num10-3/10-3_UM_webhelp/um-webhelp/Doc/java/classcom_1_1pcbsys_1_1nirvana_1_1client_1_1n_named_object.html#ad87e94310b75e2a5ea12aa227ce12dd6
https://techcommunity.softwareag.com/ecosystem/documentation/onlinehelp/Rohan/num10-3/10-3_UM_webhelp/um-webhelp/Doc/java/classcom_1_1pcbsys_1_1nirvana_1_1client_1_1n_channel.html#addb0cdebfa61dd9ebb05c91fce2b16f5

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.

nNamedObject.getOutstandingEvents

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