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

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

Introduction

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

Prototype

HttpStatus statusCode();

Source Link

Document

Return the HTTP status code as an HttpStatus enum value.

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());
        }/*www . j  ava 2 s . c  om*/
        return Mono.delay(Duration.ofSeconds(1));
    }
    return response.bodyToMono(this.props.getSource().getType()).map(value -> message(response, value));
}