问题
I've written an application with the server side applying the Event Sourcing pattern, with all incoming commands processed sequentially with the Reactor. I get those commands from client connexions. Alas, my Netty Pipeline publishes commands with no respect for the Reactive Contract. Reactor Netty could be a part of a solution, because it enforces the Reactive Contract down to the Netty Pipeline.
But with Reactor Netty, each connection in a Flux. Connections are added and removed.
How do I merge dynamically several Flux in one? How to round-robin through incoming Fluxes?
回答1:
I'm not quite sure if I understood your questions correctly, if you need an event stream whose events are generated in an async way, you can try to use reactor.core.publisher.TopicProcessor. With TopicProcessor, we created a stack whose event came from several different sources and we can process it as one reactive stream.
I'm also quite new at reactor-netty, but there are very few resources available on the internet, so I would like to provide my humble opinion for your reference.
来源:https://stackoverflow.com/questions/52789435/dynamically-merging-fluxes