Fix issues with binders and BindingProvider
When multiple binders are present with at least one of them is marked with BindingProvider, it skips scanning functions for regular message channel based binders. Resolves #1820
This commit is contained in:
committed by
Oleg Zhurakousky
parent
ad64df05a1
commit
713c252576
@@ -588,12 +588,7 @@ public class FunctionConfiguration {
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
Class<?>[] configurationClasses = binderTypeRegistry.getAll().values().iterator().next()
|
||||
.getConfigurationClasses();
|
||||
boolean bindingProvider = Stream.of(configurationClasses)
|
||||
.filter(clazz -> AnnotationUtils.findAnnotation(clazz, BindingProvider.class) != null)
|
||||
.findFirst().isPresent();
|
||||
if (!bindingProvider
|
||||
if (nonBindingProviderBindersFound()
|
||||
&& ObjectUtils.isEmpty(applicationContext.getBeanNamesForAnnotation(EnableBinding.class))
|
||||
&& this.determineFunctionName(functionCatalog, environment)) {
|
||||
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) applicationContext.getBeanFactory();
|
||||
@@ -626,6 +621,11 @@ public class FunctionConfiguration {
|
||||
}
|
||||
}
|
||||
|
||||
private boolean nonBindingProviderBindersFound() {
|
||||
return binderTypeRegistry.getAll().values().stream().anyMatch(binderType -> Stream.of(binderType.getConfigurationClasses())
|
||||
.anyMatch(clazz -> AnnotationUtils.findAnnotation(clazz, BindingProvider.class) == null));
|
||||
}
|
||||
|
||||
private boolean determineFunctionName(FunctionCatalog catalog, Environment environment) {
|
||||
String definition = streamFunctionProperties.getDefinition();
|
||||
if (!StringUtils.hasText(definition)) {
|
||||
|
||||
Reference in New Issue
Block a user