List of usage examples for org.springframework.web.reactive.function BodyExtractors toDataBuffers
public static BodyExtractor<Flux<DataBuffer>, ReactiveHttpInputMessage> toDataBuffers()
From source file:org.springframework.cloud.gateway.filter.WebClientWriteResponseFilter.java
@Override public Mono<Void> filter(ServerWebExchange exchange, GatewayFilterChain chain) { // NOTICE: nothing in "pre" filter stage as CLIENT_RESPONSE_ATTR is not added // until the WebHandler is run return chain.filter(exchange).then(Mono.defer(() -> { ClientResponse clientResponse = exchange.getAttribute(CLIENT_RESPONSE_ATTR); if (clientResponse == null) { return Mono.empty(); }//from w ww . j ava 2s . co m log.trace("WebClientWriteResponseFilter start"); ServerHttpResponse response = exchange.getResponse(); return response.writeWith(clientResponse.body(BodyExtractors.toDataBuffers())) .log("webClient response"); })); }