stream consumer invoker target now expects Flux
This commit is contained in:
@@ -101,7 +101,7 @@ public class StreamConfiguration {
|
||||
@ConditionalOnProperty("spring.cloud.stream.bindings.input.destination")
|
||||
public StreamListeningConsumerInvoker<Object> invoker(FunctionCatalog registry) {
|
||||
String name = properties.getEndpoint();
|
||||
Consumer<Object> consumer = registry.lookupConsumer(name);
|
||||
Consumer<Flux<Object>> consumer = registry.lookupConsumer(name);
|
||||
return new StreamListeningConsumerInvoker<Object>(consumer);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -29,14 +29,14 @@ import reactor.core.publisher.Flux;
|
||||
*/
|
||||
public class StreamListeningConsumerInvoker<T> {
|
||||
|
||||
private final Consumer<T> consumer;
|
||||
private final Consumer<Flux<T>> consumer;
|
||||
|
||||
public StreamListeningConsumerInvoker(Consumer<T> consumer) {
|
||||
public StreamListeningConsumerInvoker(Consumer<Flux<T>> consumer) {
|
||||
this.consumer = consumer;
|
||||
}
|
||||
|
||||
@StreamListener
|
||||
public void handle(@Input(Processor.INPUT) Flux<T> input) {
|
||||
input.subscribe(this.consumer);
|
||||
this.consumer.accept(input);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user