Example usage for org.springframework.web.reactive.function.client ClientResponse bodyToMono

List of usage examples for org.springframework.web.reactive.function.client ClientResponse bodyToMono

Introduction

In this page you can find the example usage for org.springframework.web.reactive.function.client ClientResponse bodyToMono.

Prototype

<T> Mono<T> bodyToMono(ParameterizedTypeReference<T> elementTypeRef);

Source Link

Document

Extract the body to a Mono .

Usage

From source file:org.springframework.cloud.function.web.source.HttpSupplier.java

private Mono<?> transform(ClientResponse response) {
    HttpStatus status = response.statusCode();
    if (!status.is2xxSuccessful()) {
        if (this.props.isDebug()) {
            logger.info("Delaying supplier based on status=" + response.statusCode());
        }//  ww  w  . j av a2 s .c  o  m
        return Mono.delay(Duration.ofSeconds(1));
    }
    return response.bodyToMono(this.props.getSource().getType()).map(value -> message(response, value));
}