i’m new to the webMethods 10.5 version and i’m trying to migrate a java service that returned in 9.12 version the number of pending events of a channel this way :
And regarding to the question related to pending events on the channel, Are you looking for the no of events which are not yet consumed from the named object (which is called as durable in 10.5)? If yes, did you try getOutstandingEvents() call.
" nbPendingEvents = channel.getLastEID()- durableManager.getAll()[0].getEID();" - is this call returning 0 always?
In case you are looking for number of events on the channel you can use the following API.
/**
Gets the number of events on this channel
@return a long specifying the number of events on this channel
@throws nChannelNotFoundException the n channel not found exception
@throws nSecurityException the n security exception
@throws nSessionNotConnectedException the n session not connected exception
@throws nRequestTimedOutException the n request timed out exception
@throws nSessionPausedException the n session paused exception
@throws nUnexpectedResponseException Received a response from the server for which we can not deal with,
see the message for further information. One condition of this is if this object has been invalidated and no
longer
can be utilised, this can occur if a delete request has been issued to the connected server.
*/
public long getEventCount() throws
nChannelNotFoundException,
nSecurityException,
nSessionNotConnectedException,
nRequestTimedOutException,
nSessionPausedException,
nUnexpectedResponseException {
checkIllegalStateUnexpected();
return getBaseChannel().getEventCount();
}
Also number of outstanding event per durable can be obtain from following API
/**
Returns the number of outstanding events to be consumed for this durable object.
@return number of outstanding events
@since 9.12
*/
public long getOutstandingEvents() {
return myLength;
}
Having said that, previous code logic does not either give outstanding event on durable or current no of event and can be simplified in the latest release.