Dynamically merging Fluxes

允我心安 提交于 2019-12-11 17:55:55

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!