Add consumer lookup, for single consumer in catalog

Related to issue #454

Resolves #455
This commit is contained in:
Arno
2020-03-05 15:52:44 +01:00
committed by Oleg Zhurakousky
parent 1d2377ef85
commit 013e714c42

View File

@@ -327,6 +327,12 @@ public abstract class AbstractSpringFunctionAdapterInitializer<C> implements Clo
this.supplier = this.catalog.lookup(Supplier.class, functionName); this.supplier = this.catalog.lookup(Supplier.class, functionName);
return; return;
} }
functionName = this.catalog.getNames(Consumer.class).stream()
.findFirst().orElseGet(() -> null);
if (functionName != null) {
this.consumer = this.catalog.lookup(Consumer.class, functionName);
return;
}
} }
else { else {
name = this.doResolveName(targetContext); name = this.doResolveName(targetContext);