diff --git a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ActivitiMessagingDestinationsAutoConfiguration.java b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ActivitiMessagingDestinationsAutoConfiguration.java index 8a96cb2618..1db8609f9a 100644 --- a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ActivitiMessagingDestinationsAutoConfiguration.java +++ b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ActivitiMessagingDestinationsAutoConfiguration.java @@ -39,6 +39,7 @@ public ActivitiMessagingDestinationTransformer activitiMessagingDestinationTrans return new ActivitiMessagingDestinationTransformer(messagingProperties); } + @Lazy @Bean public ActivitiMessagingDestinationsBeanPostProcessor activitiMessagingDestinationsBeanPostProcessor( ActivitiMessagingDestinationTransformer destinationTransformer @@ -46,11 +47,13 @@ public ActivitiMessagingDestinationsBeanPostProcessor activitiMessagingDestinati return new ActivitiMessagingDestinationsBeanPostProcessor(destinationTransformer); } + @Lazy @Bean public InputConverterFunction toLowerCase() { return String::toLowerCase; } + @Lazy @Bean public InputConverterFunction escapeIllegalChars(@Lazy ActivitiCloudMessagingProperties messagingProperties) { return value -> diff --git a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ConnectorConfiguration.java b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ConnectorConfiguration.java index a64f2d252d..b683779f28 100644 --- a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ConnectorConfiguration.java +++ b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/ConnectorConfiguration.java @@ -32,6 +32,7 @@ import org.springframework.cloud.stream.config.BinderFactoryAutoConfiguration; import org.springframework.cloud.stream.function.FunctionConfiguration; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; import org.springframework.integration.core.GenericHandler; import org.springframework.integration.core.GenericSelector; import org.springframework.integration.dsl.IntegrationFlow; @@ -61,6 +62,7 @@ IntegrationFlow functionBindingSelectorDiscardFlow() { .get(); } + @Lazy @Bean(name = "connectorBindingPostProcessor") public BeanPostProcessor connectorBindingPostProcessor( FunctionAnnotationService functionAnnotationService, diff --git a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/FunctionBindingConfiguration.java b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/FunctionBindingConfiguration.java index 47c64cd54b..4cabb1c1cf 100644 --- a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/FunctionBindingConfiguration.java +++ b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/FunctionBindingConfiguration.java @@ -46,6 +46,7 @@ import org.springframework.context.ConfigurableApplicationContext; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.DependsOn; +import org.springframework.context.annotation.Lazy; import org.springframework.context.annotation.Primary; import org.springframework.integration.core.GenericHandler; import org.springframework.integration.core.GenericSelector; @@ -108,6 +109,7 @@ IntegrationFlow functionBindingSelectorDiscardFlow() { .get(); } + @Lazy @Bean(name = "functionBindingBeanPostProcessor") public BeanPostProcessor functionBindingBeanPostProcessor( FunctionAnnotationService functionAnnotationService, diff --git a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/InputBindingConfiguration.java b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/InputBindingConfiguration.java index f645458a40..eee514c676 100644 --- a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/InputBindingConfiguration.java +++ b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/InputBindingConfiguration.java @@ -26,6 +26,7 @@ import org.springframework.cloud.stream.function.StreamFunctionProperties; import org.springframework.cloud.stream.messaging.DirectWithAttributesChannel; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; import org.springframework.messaging.MessageChannel; import org.springframework.util.StringUtils; @@ -34,6 +35,7 @@ public class InputBindingConfiguration extends AbstractFunctionalBindingConfigur public static final String INPUT_BINDING = "_sink"; + @Lazy @Bean public BeanPostProcessor inputBindingBeanPostProcessor( FunctionAnnotationService functionAnnotationService, diff --git a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/OutputBindingConfiguration.java b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/OutputBindingConfiguration.java index ea36cb43ab..266041f515 100644 --- a/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/OutputBindingConfiguration.java +++ b/activiti-cloud-service-common/activiti-cloud-service-messaging-config/src/main/java/org/activiti/cloud/common/messaging/config/OutputBindingConfiguration.java @@ -32,6 +32,7 @@ import org.springframework.cloud.stream.function.StreamFunctionProperties; import org.springframework.cloud.stream.messaging.DirectWithAttributesChannel; import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Lazy; import org.springframework.messaging.Message; import org.springframework.messaging.MessageChannel; import org.springframework.messaging.MessageHeaders; @@ -52,6 +53,7 @@ public class OutputBindingConfiguration extends AbstractFunctionalBindingConfigu public static final String OUTPUT_BINDING = "_source"; + @Lazy @Bean public BeanPostProcessor outputBindingBeanPostProcessor( FunctionAnnotationService functionAnnotationService,