Affects: 5.3.22
Feature Request:
When using @RecordApplicationEvents
, currently the ApplicationEventsHolder
uses a ThreadLocal
to save published events. Can this be extended to also retrieve events across all threads?
Use cases:
- Assert on async events
- Whether or not the event itself was async, when using an async test library like Awaitility in this way:
await().untilAsserted(() -> assertThat(applicationEvents.stream())..... );
The assertion runs in a different thread (so that Awaitility can time and interrupt if necessary), so no events are found whatsoever.
Comment From: simonbasle
I think that making the holder threadlocal an InheritableThreadLocal
would solve this issue, wdyt?
Comment From: sbrannen
- Superseded by #29827