Closed
Description
Currently, a warning is logged when more than one functional bean is detected. The suggestion is to first check if the function is listed in the ineligible properties and, if so, skip the verification before logging the warning.
if (!StringUtils.hasText(functionDefinition)) {
Collection<Object> functionalBeans = this.getNames(null).stream()
.filter(name -> !RoutingFunction.FUNCTION_NAME.equals(name))
.filter(name -> !RoutingFunction.DEFAULT_ROUTE_HANDLER.equals(name))
.collect(Collectors.toList());
if (!CollectionUtils.isEmpty(functionalBeans) && functionalBeans.size() > 1) {
logger.warn("Multiple functional beans were found " + functionalBeans + ", thus can't determine default function definition. Please "
+ "use 'spring.cloud.function.definition' property to explicitly define it. ");
}
}
if (!isFunctionDefinitionEligible(functionDefinition)) {
return null;
}