Skip to content

Commit 96e16cc

Browse files
committed
GH-1240 Fix logging for ineligible functions
Resolves #1240
1 parent 9c59ecf commit 96e16cc

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

spring-cloud-function-context/src/main/java/org/springframework/cloud/function/context/catalog/BeanFactoryAwareFunctionRegistry.java

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,9 @@ public <T> T lookup(Class<?> type, String functionDefinition, String... expected
124124
if (!this.applicationContext.containsBean(functionDefinition) || !KotlinDetector.isKotlinType(this.applicationContext.getBean(functionDefinition).getClass())) {
125125
functionDefinition = this.normalizeFunctionDefinition(functionDefinition);
126126
}
127+
if (!isFunctionDefinitionEligible(functionDefinition)) {
128+
return null;
129+
}
127130
if (!StringUtils.hasText(functionDefinition)) {
128131
Collection<Object> functionalBeans = this.getNames(null).stream()
129132
.filter(name -> !RoutingFunction.FUNCTION_NAME.equals(name))
@@ -134,9 +137,7 @@ public <T> T lookup(Class<?> type, String functionDefinition, String... expected
134137
+ "use 'spring.cloud.function.definition' property to explicitly define it. ");
135138
}
136139
}
137-
if (!isFunctionDefinitionEligible(functionDefinition)) {
138-
return null;
139-
}
140+
140141
FunctionInvocationWrapper function = this.doLookup(type, functionDefinition, expectedOutputMimeTypes);
141142
Object syncInstance = functionDefinition == null ? this : functionDefinition;
142143
synchronized (syncInstance) {

0 commit comments

Comments
 (0)