Reactive @StreamListener

Viewed 1387

Just a quick one.

Is it possible to have a reactive @StreamListener Input with Spring Cloud Stream? What I mean by that is something like this:

@StreamListener
public void log(@Input(Sink.INPUT) Flux<String> strings)
{
    strings.log();
}

In the documentation I only saw examples like this:

@StreamListener(Sink.INPUT)
public void log(String message)
{
    log.info(message);
}

or of Processors like this:

@StreamListener
@Output(Source.OUTPUT)
public Flux<String> log(@Input(Sink.INPUT) Flux<String> strings)
{
    return strings.map(String::toUpperCase);
}

When I run the code from the first snippet I get a Dispatcher has no subscribers exception.

1 Answers
Related