INT-4462: WebFluxInbound: cope with empty body

JIRA: https://jira.spring.io/browse/INT-4462

When the HTTP request body is empty, the `HttpMessageReader` ends up
with the empty `Mono` which can't be evaluated to any reasonable value.

* Add fallback to `requestParams` when `Mono` for body is empty and
also when `payloadExpression` returns null

**Cherry-pick to 5.0.x**
This commit is contained in:
Artem Bilan
2018-05-07 12:08:44 -04:00
committed by Gary Russell
parent 48e8b14475
commit 4d8494ae76
3 changed files with 36 additions and 6 deletions

View File

@@ -6,7 +6,7 @@
The WebFlux Spring Integration module (`spring-integration-webflux`) allows for the execution of HTTP requests and the processing of inbound HTTP requests in Reactive manner.
The WebFlux support consists of the following gateway implementations: `WebFluxInboundEndpoint`, `WebFluxRequestExecutingMessageHandler`.
The implementation is fully based on the Spring http://docs.spring.io/spring/docs/5.0.0.RC3/spring-framework-reference/web.html#web-reactive[WebFlux] and https://projectreactor.io/[Project Reactor] foundations.
The implementation is fully based on the Spring https://docs.spring.io/spring/docs/current/spring-framework-reference/web-reactive.html#spring-webflux[WebFlux] and https://projectreactor.io/[Project Reactor] foundations.
Also see <<http>> for more information since many options are shared between reactive and regular HTTP components.
[[webflux-inbound]]
@@ -65,6 +65,8 @@ public IntegrationFlow sseFlow() {
Also see <<http-request-mapping>> and <<http-cors>> for more possible configuration options.
When the request body is empty, or `payloadExpression` returns `null`, the request params `MultiValueMap<String, String>` is used for a `payload` of the target message to process.
[[webflux-outbound]]
=== WebFlux Outbound Components