GH-573 Ensure registered functions are accounted during the lookup

Resolves #573
This commit is contained in:
Oleg Zhurakousky
2020-08-04 19:35:05 +02:00
parent 2f36dbccb3
commit f4fcf1ccd0

View File

@@ -144,7 +144,9 @@ public class SimpleFunctionRegistry implements FunctionRegistry, FunctionInspect
if (!routing && this.declaredFunctionDefinitions.size() > 0) {
if (StringUtils.hasText(definition)) {
if (this.declaredFunctionDefinitions.size() > 1 && !this.declaredFunctionDefinitions.contains(definition)) {
if (this.declaredFunctionDefinitions.size() > 1
&& !this.declaredFunctionDefinitions.contains(definition)
&& !this.registrationsByName.containsKey(definition)) {
logger.warn("Attempted to access un-declared function definition '" + definition + "'. Declared functions are '" + this.declaredFunctionDefinitions
+ "' specified via `spring.cloud.function.definition` property. If the intention is to access "
+ "any function available in FunctionCatalog, please remove `spring.cloud.function.definition` property.");