reactor-bus | Legacy Reactor Bus | Application Framework library
kandi X-RAY | reactor-bus Summary
kandi X-RAY | reactor-bus Summary
Legacy Reactor Bus
Support
Quality
Security
License
Reuse
Top functions reviewed by kandi - BETA
Currently covering the most popular Java, JavaScript and Python libraries. See a Sample of reactor-bus
reactor-bus Key Features
reactor-bus Examples and Code Snippets
Community Discussions
Trending Discussions on reactor-bus
QUESTION
With the (meanwhile deprecated) reactor-bus from project-reactor I had the API eventBus.sendAndReceive(Event e, Consumer callback)
.
This allowed to trigger execution by publishing an event and automatically subscribe to a response.
With Spring eventListeners I can publish another event from an EventListener method, but I am missing the feature to directly subscribe to a return value.
How do I achieve the same behaviour with spring? How do I programmaticcaly register/unregister listeners and how do I make the topics dynamic?
...ANSWER
Answered 2018-Aug-15 at 02:52With Spring's ApplicationEventMulticaster
you can't subscribe to a response. You probably noticed that the onApplicationEvent
method returns void
! The reason for this is because literally all it does is either call the Subscriber (i.e. ApplicationListener
) synchronously, or runs the listener method asynchronously on an executor without returning any type of Future
.
Spring's Project Reactor evolved a while ago to match the Reactive Manifesto and similar frameworks (like RxJava) more closely. Now with Spring 5 (with which Reactor comes with by default) you can use Reactor and RxJava interchangeably.
That being the case, regarding your questions:
How do I achieve the same behaviour with spring?
You use the new version of Reactor Core and the functional programming features of Flux
, Mono
, etc.
With Spring eventListeners I can publish another event from an EventListener method, but I am missing the feature to directly subscribe to a return value.
If you look at the API for Flux
, you'll see that it has a fluent and functional API (in some ways similar to Java 8 streams).
QUESTION
I have a post operation which takes multipartfile as request, i would like to store it on the FTP later.
But for now I have just the method setup and when trying to invoke from postman, it gives me an error response HTTP 415.
This is what I have:
CONTROLLER:
...ANSWER
Answered 2018-May-12 at 21:58You have multiple issues:
- You are mixing Jersey related annotations with Spring MVC ones.These are not working with Jersey, since they are Spring MVC specifics.
Instead of using these imports:
QUESTION
I have an issue while trying to make the upgrade.
Currently i'm using version 2.0.x, and in particular -
...ANSWER
Answered 2017-Jan-18 at 09:44reactor.fn.Consumer
is replaced by Java 8 java.util.function.Consumer
.
As for RingBufferProcessor
you have to pick one of new processors all using ring buffer.
Dispatcher
s are now Schedulers that use Java's Executor
s under the hood.
Community Discussions, Code Snippets contain sources that include Stack Exchange Network
Vulnerabilities
No vulnerabilities reported
Install reactor-bus
Support
Reuse Trending Solutions
Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items
Find more librariesStay Updated
Subscribe to our newsletter for trending solutions and developer bootcamps
Share this Page