Special handle for void in the RSocketOutGateway

To avoid extra `Publisher` subscription work in the target
application "flatten" a returned empty `Flux` for the `void`
expected type into a `Mono.empty()` for automatic subscription
on the output channel
This commit is contained in:
Artem Bilan
2020-12-21 17:18:37 -05:00
committed by Gary Russell
parent c38da2f4ee
commit fa1ab223ae
3 changed files with 47 additions and 2 deletions

View File

@@ -188,6 +188,9 @@ public Flux<?> flattenRSocketResponse(Flux<?> payload) {
Or subscribed explicitly in the target application logic.
The expected response type can also be configured (or evaluated via expression) to `void` treating this gateway as an outbound channel adapter.
However the `outputChannel` still has to be configured (even if it just a `NullChannel`) to initiate a subscription to the returned `Mono`.
See <<rsocket-java-config>> for samples how to configure an `RSocketOutboundGateway` endpoint a deal with payloads downstream.
[[rsocket-namespace]]