diff --git a/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc b/framework-docs/modules/ROOT/pages/integration/rest-clients.adoc index 333dae25151..005c3056e19 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` -| Perform the given request, and release the response content, if any. +| `void` +| Perform the given request. -| `HttpHeaders`, `Mono` -| Perform the given request, release the response content, if any, and return the - response headers. +| `HttpHeaders` +| Perform the given request and return the response headers. -| ``, `Mono` +| `` | Perform the given request and decode the response content to the declared return type. -| ``, `Flux` -| Perform the given request and decode the response content to a stream of the declared - element type. +| `ResponseEntity` +| Perform the given request and return a `ResponseEntity` with the status and headers. -| `ResponseEntity`, `Mono>` -| Perform the given request, and release the response content, if any, and return a - `ResponseEntity` with the status and headers. - -| `ResponseEntity`, `Mono>` +| `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. + +| `Mono` +| Perform the given request, release the response content, if any, and return the +response headers. + +| `Mono` +| Perform the given request and decode the response content to the declared return type. + +| `Flux` +| Perform the given request and decode the response content to a stream of the declared +element type. + +| `Mono>` +| Perform the given request, and release the response content, if any, and return a +`ResponseEntity` with the status and headers. + +| `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. + | `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