GH-342 - Allow disabling event externalization.

We now expose spring.modulith.events.externalization.enabled that can be set to false to disable the event externalization completely. Useful in test cases, for example.
This commit is contained in:
Oliver Drotbohm
2023-10-23 12:22:42 +02:00
parent 69fd64dbf7
commit 576b8f5074
11 changed files with 235 additions and 1 deletions

View File

@@ -77,6 +77,15 @@ public interface EventExternalizationConfiguration {
return new Selector();
}
/**
* Disables event externalization by not matching any events at all.
*
* @return will never be {@literal null}.
*/
public static EventExternalizationConfiguration disabled() {
return externalizing().select(__ -> false).build();
}
/**
* A {@link Predicate} to select all events annotated as to be externalized. The currently supported annotations are:
* <ul>