Proper way of implementing stream relay

Viewed 25

I'm implementing a stream relay using webflux. I have a @GetControler("{id}") which returns Flux<byte[]>, and a @PostController("{id}") which receives Flux<byte[]>.

What's the proper way of implementing?

I accomplished the task using Sinks.One<Flux<byte[]>>, but I think this is wired since it's wrapping "future" inside "future". I was thinking Sinks.Many<byte[]> but that won't work because there is no "pausing" back-pressure, and the buffer will eventually overflow.

BTW, what should I return for the "sender" side? void? Disposable? Mono.never()?

BTW 2, I tried DataBuffer, but it seems to have wired "double free" issue. Especially in scenario of multi-casing. What's the proper way of using this?

0 Answers
Related