open static fun <T : Any> toFlux(elementClass: Class<out T>): BodyExtractor<Flux<T>, ReactiveHttpInputMessage>
Return a BodyExtractor that reads into a Reactor Flux.
elementClass - the class of element in the Flux
Return
a BodyExtractor that reads a flux
open static fun <T : Any> toFlux(typeReference: ParameterizedTypeReference<T>): BodyExtractor<Flux<T>, ReactiveHttpInputMessage>
Return a BodyExtractor that reads into a Reactor Flux. The given ParameterizedTypeReference is used to pass generic type information, for instance when using the org.springframework.web.reactive.function.client.WebClient
Flux<ServerSentEvent<String>> body = this.webClient .get() .uri("http://example.com") .exchange() .flatMap(r -> r.body(toFlux(new ParameterizedTypeReference<ServerSentEvent<String>>() {})));
typeReference - a reference to the type of element in the Flux
Return
a BodyExtractor that reads a flux