Skip to content

Commit

Permalink
spring-projectsGH-581 | add possibility to use IncompleteEventPublica…
Browse files Browse the repository at this point in the history
…tions.findAll method
  • Loading branch information
tomasz.patrzalek committed May 22, 2024
1 parent 8a82d55 commit c104b36
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
package org.springframework.modulith.events;

import java.time.Duration;
import java.util.Collection;
import java.util.function.Predicate;

/**
Expand All @@ -26,6 +27,13 @@
*/
public interface IncompleteEventPublications {

/**
* Returns all {@link EventPublication}s that have not been completed.
*
* @return will never be {@literal null}.
*/
Collection<? extends EventPublication> findAll();

/**
* Triggers the re-submission of events for which incomplete {@link EventPublication}s are registered. Note, that this
* will materialize <em>all</em> incomplete event publications.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -144,6 +144,11 @@ protected Collection<ApplicationListener<?>> getApplicationListeners(Application
.toList();
}

@Override
public Collection<? extends EventPublication> findAll() {
return registry.get().findIncompletePublications();
}

/*
* (non-Javadoc)
* @see org.springframework.modulith.events.IncompleteEventPublications#resubmitIncompletePublications(java.util.function.Predicate)
Expand Down

0 comments on commit c104b36

Please sign in to comment.