The original question is posted on StackOverflow, check here.
My code sample is here.
Currently, I have to add a new line delimiter to every item in the Flux in the client and let server side know it should be a Flux.
Flux.just("a\n", "b\n", "c\n", "d\n")
Currently, I have not tried other interaction modes Like regular @Controller/@RequestMapping, RSocketInboundGateway should accept the following payloads.
- (empty)
- T
- Mono<T>
- Flux<T>
The following explanation is quoted from the answer from @artembilan:
Currently the server side of Spring Integration doesn't treat an incoming Flux as a stream of independent payloads. So, we try to connect all of them into a single value. The new line delimiter is an indicator that we expect independent values. Spring Messaging on its side does exactly opposite: it checks for multi-value expected type and decode every element in the incoming Flux in its map() instead of an attempt for the whole Publisher decoding.
It's going to be kinda breaking change, but possibly need to consider to fix RSocketInboundGateway logic to be consistent with regular @MessageMapping for RSocket support.