GH-444 Fixed support for default function lookup
Given that function can be looked up with no definition, the fallback alternative should be 'spring.cloud.function.definition' property Resolves #444
This commit is contained in:
@@ -125,6 +125,9 @@ public class BeanFactoryAwareFunctionRegistry
|
||||
@Override
|
||||
@SuppressWarnings("unchecked")
|
||||
public <T> T lookup(String definition, String... acceptedOutputTypes) {
|
||||
if (!StringUtils.hasText(definition)) {
|
||||
definition = this.applicationContext.getEnvironment().getProperty("spring.cloud.function.definition");
|
||||
}
|
||||
Object function = this.proxyInvokerIfNecessary((FunctionInvocationWrapper) this.compose(null, definition, acceptedOutputTypes));
|
||||
return (T) function;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user