Universal Messaging 10.1 | Concepts | Commonly Used Features | Durable Event Browsing and Purging
 
Durable Event Browsing and Purging
Durable Event Browsing
You can browse the un-acknowledged events on all durable types (Exclusive, Priority, SharedQueued, Shared).
To do this, you need the durable object associated with the channel you want to browse, which you can get as follows:
nDurable durable = myChannel.getDurableManager().get("your durable name");
nDurableViewer durableViewer = durable.createViewer();
The nDurableViewer object has two methods:
*next() - Returns the next un-acknowledged nConsumeEvent. If there are no further events to be consumed at this time, the method returns null.
*close() - Closes the created nDurableViewer.
Durable Event Purging
You can purge the un-acknowledged events on a durable.
To purge events, you need the durable object again:
nDurable durable = myChannel.getDurableManager().get("your durable name");
The durable object offers the following methods:
*removeAll - Removes all events on the durable.
*remove(long start , long end) - Removes an event range on a durable.
*remove(String filter) - Removes events matching a filter on a durable.
*remove(long eid) - Removes a single event with corresponding Event ID from the durable.
Currently, the purge capability is only supported for Shared Durables (i.e. on the nSharedDurable implementation of the nDurable object). If any of the above listed remove methods is called on a non-Shared durable it will throw an nIllegalStateException.