Interface EventPublicationRegistry
- All Known Implementing Classes:
DefaultEventPublicationRegistry
public interface EventPublicationRegistry
A registry to capture event publications to
ApplicationListeners. Allows to
register those publications, mark them as completed and lookup incomplete publications.- Author:
- Oliver Drotbohm, Björn Kieling, Dmitry Belyaev
-
Method Summary
Modifier and TypeMethodDescriptionvoiddeleteCompletedPublicationsOlderThan(Duration duration) Deletes all completedTargetEventPublications that have been completed before the givenDuration.Returns allTargetEventPublications that have not been completed yet.findIncompletePublicationsOlderThan(Duration duration) Returns allTargetEventPublications that have not been completed yet and have been published before the given duration in relation to "now".voidmarkCompleted(Object event, PublicationTargetIdentifier targetIdentifier) Marks the publication for the given event andPublicationTargetIdentifieras completed.voidmarkFailed(Object event, PublicationTargetIdentifier targetIdentifier) Marks the publication for the given event andPublicationTargetIdentifieras failed.voidmarkProcessing(Object event, PublicationTargetIdentifier identifier) Marks the publication for the given event andPublicationTargetIdentifieras processing.voidmarkStalePublicationsFailed(Staleness staleness) Marks allEventPublications considered stale as failed.voidprocessFailedPublications(ResubmissionOptions options, Consumer<TargetEventPublication> consumer) Processes all failedEventPublications matching the givenResubmissionOptionswith the givenConsumer.voidprocessIncompletePublications(Predicate<EventPublication> filter, Consumer<TargetEventPublication> consumer, @Nullable Duration duration) Processes all incomplete event publications that have been published before the given duration in relation to "now" by applying the given filter passing all remaining instances to the givenConsumer.store(Object event, Stream<PublicationTargetIdentifier> listeners) StoresTargetEventPublications for the given event andApplicationListeners.
-
Method Details
-
store
Collection<TargetEventPublication> store(Object event, Stream<PublicationTargetIdentifier> listeners) StoresTargetEventPublications for the given event andApplicationListeners.- Parameters:
event- must not be null.listeners- must not be null.
-
findIncompletePublications
Collection<TargetEventPublication> findIncompletePublications()Returns allTargetEventPublications that have not been completed yet.- Returns:
- will never be null.
-
findIncompletePublicationsOlderThan
Returns allTargetEventPublications that have not been completed yet and have been published before the given duration in relation to "now".- Parameters:
duration- must not be null.- Returns:
- will never be null.
- Since:
- 1.1
-
markProcessing
Marks the publication for the given event andPublicationTargetIdentifieras processing.- Parameters:
event- must not be null.identifier- must not be null.- Since:
- 2.0
- See Also:
-
markCompleted
Marks the publication for the given event andPublicationTargetIdentifieras completed.- Parameters:
event- must not be null.targetIdentifier- must not be null.- See Also:
-
markFailed
Marks the publication for the given event andPublicationTargetIdentifieras failed.- Parameters:
event- must not be null.targetIdentifier- must not be null.- Since:
- 1.3
- See Also:
-
deleteCompletedPublicationsOlderThan
Deletes all completedTargetEventPublications that have been completed before the givenDuration.- Parameters:
duration- must not be null.
-
processIncompletePublications
void processIncompletePublications(Predicate<EventPublication> filter, Consumer<TargetEventPublication> consumer, @Nullable Duration duration) Processes all incomplete event publications that have been published before the given duration in relation to "now" by applying the given filter passing all remaining instances to the givenConsumer.- Parameters:
filter- must not be null.consumer- must not be null.duration- can be null.- Since:
- 1.3
-
processFailedPublications
void processFailedPublications(ResubmissionOptions options, Consumer<TargetEventPublication> consumer) Processes all failedEventPublications matching the givenResubmissionOptionswith the givenConsumer.- Parameters:
options- must not be null.consumer- must not be null.- Since:
- 2.0
-
markStalePublicationsFailed
Marks allEventPublications considered stale as failed. WhichEventPublications will be affected can differ from implementation to implementation.- Parameters:
staleness- must not be null.- Since:
- 2.0
-