diff --git a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc index 333dae251517..005c3056e19f 100644 --- a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc +++ b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc @@ -495,45 +495,76 @@ method parameters: [[rest-http-interface-return-values]] === Return Values -Annotated, HTTP exchange methods support the following return values: +The supported return values vary depending on whether you are using +`HttpExchangeAdapter` or `ReactorHttpExchangeAdapter`. + +When using `HttpExchangeAdapter`, annotated HTTP exchange methods support +the following return values: [cols="1,2", options="header"] |=== | Method return value | Description -| `void`, `Mono` +| `void` +| Perform the given request. + +| `HttpHeaders` +| Perform the given request and return the response headers. + +| `` +| Perform the given request and decode the response content to the declared return type. + +| `ResponseEntity` +| Perform the given request and return a `ResponseEntity` with the status and headers. + +| `ResponseEntity` +| Perform the given request, decode the response content to the declared return type, and + return a `ResponseEntity` with the status, headers, and the decoded body. + +|=== + +When using `ReactorHttpExchangeAdapter`, annotated HTTP exchange methods support +all the same values as the ones supported by `HttpExchangeAdapter` +and also the following ones: + +[cols="1,2", options="header"] +|=== +| Method return value | Description + +| `Mono` | Perform the given request, and release the response content, if any. -| `HttpHeaders`, `Mono` +| `Mono` | Perform the given request, release the response content, if any, and return the - response headers. +response headers. -| ``, `Mono` +| `Mono` | Perform the given request and decode the response content to the declared return type. -| ``, `Flux` +| `Flux` | Perform the given request and decode the response content to a stream of the declared - element type. +element type. -| `ResponseEntity`, `Mono>` +| `Mono>` | Perform the given request, and release the response content, if any, and return a - `ResponseEntity` with the status and headers. +`ResponseEntity` with the status and headers. -| `ResponseEntity`, `Mono>` +| `Mono>` | Perform the given request, decode the response content to the declared return type, and - return a `ResponseEntity` with the status, headers, and the decoded body. +return a `ResponseEntity` with the status, headers, and the decoded body. | `Mono>` | Perform the given request, decode the response content to a stream of the declared - element type, and return a `ResponseEntity` with the status, headers, and the decoded - response body stream. +element type, and return a `ResponseEntity` with the status, headers, and the decoded +response body stream. |=== TIP: You can also use any other async or reactive types registered in the `ReactiveAdapterRegistry`. -By default, the behavior of HTTP service methods with synchronous (blocking) method +While using the `ReactorHttpExchangeAdapter`, by default, the behavior +of HTTP service methods with synchronous (blocking) method signature depends on connection and timeout settings of the underlying HTTP client. `HttpServiceProxyFactory.Builder` does expose a `blockTimeout` option that also lets you configure the maximum time to block for a response, but we recommend configuring timeout