From 56bb512e6ea0a3c7545ed3df1cba14a9fe5bc43d Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Fri, 11 Mar 2022 17:22:49 +0100 Subject: [PATCH] GH-2292 Update documentation explaining reactive/imparative composition Resolves #2292 --- core/docs/src/main/asciidoc/spring-cloud-stream.adoc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/core/docs/src/main/asciidoc/spring-cloud-stream.adoc b/core/docs/src/main/asciidoc/spring-cloud-stream.adoc index 7255a5bf0..3ef5f2ca4 100644 --- a/core/docs/src/main/asciidoc/spring-cloud-stream.adoc +++ b/core/docs/src/main/asciidoc/spring-cloud-stream.adoc @@ -565,6 +565,13 @@ public Function, Mono>consumer() { But if you do need to write an explicit `Consumer>`, remember to subscribe to the incoming Flux. +Also, keep in mind that the same rule applies for function composition when mixing reactive and imperative functions. +Spring Cloud Function indeed supports composing reactive functions with imperative, however you must be aware of certain limitations. +For example, assume you have composed reactive function with imperative consumer. +The result of such composition is a reactive `Consumer`. However, there is no way to subscribe to such consumer as discussed earlier in this section, +so this limitation can only be addressed by either making your consumer reactive and subscribing manually (as discussed earlier), or changing your function to be imperative. + + ====== Polling Configuration Properties The following properties are exposed (although deprecated since version 3.2) by Spring Cloud Stream and are prefixed with the `spring.cloud.stream.poller`: