diff --git a/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/SupplierExporter.java b/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/SupplierExporter.java index a65aa35ed..09ff2d3ed 100644 --- a/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/SupplierExporter.java +++ b/spring-cloud-function-web/src/main/java/org/springframework/cloud/function/web/source/SupplierExporter.java @@ -24,6 +24,7 @@ import java.util.function.Supplier; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import org.reactivestreams.Publisher; import reactor.core.Disposable; import reactor.core.publisher.Flux; import reactor.core.publisher.Mono; @@ -90,7 +91,7 @@ public class SupplierExporter implements SmartLifecycle { Set names = this.supplier == null ? this.catalog.getNames(Supplier.class) : Collections.singleton(this.supplier); for (String name : names) { - Supplier> supplier = this.catalog.lookup(Supplier.class, name); + Supplier> supplier = this.catalog.lookup(Supplier.class, name); if (supplier == null) { logger.warn("No such Supplier: " + name); continue; @@ -156,8 +157,8 @@ public class SupplierExporter implements SmartLifecycle { callback.run(); } - private Flux forward(Supplier> supplier, String name) { - return supplier.get().flatMap(value -> { + private Flux forward(Supplier> supplier, String name) { + return Flux.from(supplier.get()).flatMap(value -> { String destination = this.destinationResolver.destination(supplier, name, value); if (this.debug) {