我只希望单独处理重播的项目。弹簧反应器如何实现?到目前为止,我提供的解决方案非常糟糕,因为它假定在50毫秒内不会出现新项目。
ConnectableFlux<MovieDTO> replayedFlux = webSocketSink.replay(500);
replayedFlux.connect();
Flux<MovieDTO> replayedFluxFiltered = replayedFlux.take(Duration.ofMillis(50L))
...; // do some processing, filtering, distinct etc.
Flux<MovieDTO> ff = Flux.concat(replayedFluxFiltered, webSocketSink);