I'm publishing Platform Events using APEX Code
EventBus.publish method and consuming the events in backend Java app using EventListener.
All the published events remains in EventBus and whenever my consumer Java app restarts, listener is receiving all the previously published events (in the past 24 hrs?, not sure about the timing though).
Is there any way to clear the events published to EventBus after some set interval? I've gone through the Platform Events documentation and couldn't find any help to tackle this problem.
Any pointer would be helpful