Removed dependency on BindingProvider
This commit is contained in:
@@ -86,24 +86,19 @@ import org.springframework.util.Assert;
|
||||
*
|
||||
* @since 1.1
|
||||
*/
|
||||
// @checkstyle:off
|
||||
public abstract class AbstractMessageChannelBinder<C extends ConsumerProperties, P extends ProducerProperties, PP extends ProvisioningProvider<C, P>>
|
||||
extends AbstractBinder<MessageChannel, C, P> implements
|
||||
PollableConsumerBinder<MessageHandler, C>, ApplicationEventPublisherAware {
|
||||
|
||||
// @checkstyle:on
|
||||
|
||||
/**
|
||||
* {@link ProvisioningProvider} delegated by the downstream binder implementations.
|
||||
*/
|
||||
protected final PP provisioningProvider;
|
||||
|
||||
// @checkstyle:off
|
||||
private final EmbeddedHeadersChannelInterceptor embeddedHeadersChannelInterceptor = new EmbeddedHeadersChannelInterceptor(
|
||||
this.logger);
|
||||
|
||||
// @checkstyle:on
|
||||
|
||||
private final ObjectMapper objectMapper = new ObjectMapper();
|
||||
|
||||
/**
|
||||
@@ -121,14 +116,6 @@ public abstract class AbstractMessageChannelBinder<C extends ConsumerProperties,
|
||||
|
||||
private ApplicationEventPublisher applicationEventPublisher;
|
||||
|
||||
// @Autowired(required = false)
|
||||
// private IntegrationFlowFunctionSupport integrationFlowFunctionSupport;
|
||||
//
|
||||
// @Autowired(required = false)
|
||||
// private StreamFunctionProperties streamFunctionProperties;
|
||||
|
||||
// private boolean producerBindingExist;
|
||||
|
||||
public AbstractMessageChannelBinder(String[] headersToEmbed,
|
||||
PP provisioningProvider) {
|
||||
this(headersToEmbed, provisioningProvider, null, null);
|
||||
|
||||
@@ -57,7 +57,6 @@ import org.springframework.cloud.function.context.catalog.FunctionTypeUtils;
|
||||
import org.springframework.cloud.function.context.config.ContextFunctionCatalogAutoConfiguration;
|
||||
import org.springframework.cloud.function.context.config.FunctionContextUtils;
|
||||
import org.springframework.cloud.function.context.config.RoutingFunction;
|
||||
import org.springframework.cloud.stream.annotation.BindingProvider;
|
||||
import org.springframework.cloud.stream.annotation.EnableBinding;
|
||||
import org.springframework.cloud.stream.binder.BinderTypeRegistry;
|
||||
import org.springframework.cloud.stream.binder.BindingCreatedEvent;
|
||||
@@ -588,8 +587,7 @@ public class FunctionConfiguration {
|
||||
|
||||
@Override
|
||||
public void afterPropertiesSet() throws Exception {
|
||||
if (nonBindingProviderBindersFound()
|
||||
&& ObjectUtils.isEmpty(applicationContext.getBeanNamesForAnnotation(EnableBinding.class))
|
||||
if (ObjectUtils.isEmpty(applicationContext.getBeanNamesForAnnotation(EnableBinding.class))
|
||||
&& this.determineFunctionName(functionCatalog, environment)) {
|
||||
BeanDefinitionRegistry registry = (BeanDefinitionRegistry) applicationContext.getBeanFactory();
|
||||
String[] functionDefinitions = streamFunctionProperties.getDefinition().split(";");
|
||||
@@ -621,11 +619,6 @@ 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