-
Notifications
You must be signed in to change notification settings - Fork 38.4k
Use of ApplicationEventPublisher
in a reactive call stack [SPR-16481]
#21025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Juergen Hoeller commented The use of So I don't think we need a Reactive Streams based variant of |
Rob Winch commented
This seems like it is relying on implementation specific details
Again it seems like this would be relying on implementation specific details. If they need to do blocking IO, how would it be done? For example, a listener that writes audit events to a data store for authentication success / failure could not be used. |
Juergen Hoeller commented Well, I would argue that After all, reactive applications need some thorough setup and strict implementation rules everywhere in any case. Bean impls can't do blocking I/O in their init callbacks either for example, otherwise |
I've finally revised the javadoc on For reactive event publication purposes, the best you can do to integrate the hand-off step into a reactive pipeline is I'm moving this to the backlog for revisiting a fully Reactor-based multicaster with tighter publisher-listener interaction at a later point. For the time being, anything that the Reactor context could contain will have to be included in the event instance itself, including contextual transaction and security holders, so that a listener can independently operate on the complete specific context that it needs. |
I found this issue after opening an ticket for failing to use a At the moment it seems it can't be done. Are there any plans to provide a Reactor-based Regarding the suggested workaround: For the time being, anything that the Reactor context could contain will have to be included in the event instance itself, including contextual transaction and security holders, so that a listener can independently operate on the complete specific context that it needs. Could you clear up how this could be done? |
As of 6.1, |
ApplicationEventPublisher
in a reactive call stack [SPR-16481]
Rob Winch opened SPR-16481 and commented
Currently there is no equivalent of reactive
ApplicationEventPublisher
which means the only way to publish events is blocking and cannot be performed in aWebFlux
application. This impacts Spring Security applications which currently cannot publish authentication events. See spring-projects/spring-security#4961Affects: 5.0.3
Issue Links:
1 votes, 8 watchers
The text was updated successfully, but these errors were encountered: