-
Notifications
You must be signed in to change notification settings - Fork 178
Closed
Description
Hi
I am trying to delete the completed events using CompletedEventPublications.deletePublications but unsure on what the best practice is, since the docs don't say much about it.
Btw, I am aware of #748.
This is a general question on how to actually trigger the action, for the case where one wants to use this functionality manually.
Is there a preferred way of using the API that works automatically or must the action always be "triggered" manually somehow?
Currently I am doing something like
@Component
@EnableScheduling
public class CompletedEventsCleaner {
private final CompletedEventPublications completedEvents;
public EventsCleaner(final CompletedEventPublications completedEvents) {
this.completedEvents = completedEvents;
}
@Scheduled(initialDelay = 5000, fixedDelay = 5000)
public void deleteCompletedEvents() {
completedEvents.deletePublications(EventPublication::isPublicationCompleted);
}
}Is this correct?
Thanks
Metadata
Metadata
Assignees
Labels
No labels