From 92379f60c7c7d535ae99aed38171c38691e1ff17 Mon Sep 17 00:00:00 2001 From: Oleg Zhurakousky Date: Fri, 24 Jan 2020 13:21:48 +0100 Subject: [PATCH] GH-1891 Updated the doc by adding a note on Consumer --- docs/src/main/asciidoc/spring-cloud-stream.adoc | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/docs/src/main/asciidoc/spring-cloud-stream.adoc b/docs/src/main/asciidoc/spring-cloud-stream.adoc index 892916c54..fec7febdc 100644 --- a/docs/src/main/asciidoc/spring-cloud-stream.adoc +++ b/docs/src/main/asciidoc/spring-cloud-stream.adoc @@ -577,6 +577,23 @@ the framework will split the returning sending out each item as an individual me he desired behavior you can set it to `false` at which point such supplier will simply return the produced Flux without splitting it. +===== Consumer (Reactive) + +Reactive `Consumer` is a little bit special because it has a void return type, leaving framework with no reference to subscribe to. +Most likely you will not need to write `Consumer>`, and instead write it as a `Function, Mono>` invoking `then` +operator as the last operator on your stream. + +For example: + +[source,java] +---- +public Function, Mono>`consumer() { + return flux -> flux.map(..).filter(..).then(); +} +---- + +But if you do need to write an explicit `Consumer>`, remember to subscribe to the incoming Flux. + ====== Polling Configuration Properties