Search code examples
spring-cloud-stream

LogConsumer Spring Cloud Function is failing due to Spring Integration Dependency


We are getting the issue when we use logConsumer function due to spring integration dependency. Please help to check.


APPLICATION FAILED TO START


Description:

An attempt was made to call a method that does not exist. The attempt was made from the following location:

org.springframework.cloud.fn.consumer.log.LogConsumerConfiguration.logConsumerFlow(LogConsumerConfiguration.java:46)

The following method did not exist:

org.springframework.integration.dsl.IntegrationFlowBuilder.log(Lorg/springframework/integration/handler/LoggingHandler$Level;Ljava/lang/String;Ljava/lang/String;)Lorg/springframework/integration/dsl/IntegrationFlowDefinition;

The method's class, org.springframework.integration.dsl.IntegrationFlowBuilder, is available from the following locations:

jar:file:/C:/Users/.m2/repository/org/springframework/integration/spring-integration-core/5.5.4/spring-integration-core-5.5.4.jar!/org/springframework/integration/dsl/IntegrationFlowBuilder.class

The class hierarchy was loaded from the following locations:

org.springframework.integration.dsl.IntegrationFlowBuilder: file:/C:/Users/.m2/repository/org/springframework/integration/spring-integration-core/5.5.4/spring-integration-core-5.5.4.jar
org.springframework.integration.dsl.IntegrationFlowDefinition: file:/C:/Users/.m2/repository/org/springframework/integration/spring-integration-core/5.5.4/spring-integration-core-5.5.4.jar
org.springframework.integration.dsl.BaseIntegrationFlowDefinition: file:/C:/Users/.m2/repository/org/springframework/integration/spring-integration-core/5.5.4/spring-integration-core-5.5.4.jar

Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.dsl.IntegrationFlowBuilder


Solution

  • Yeah... I know what is going on: the Spring Integration 5.5 has removed some intermediate class and the current (2020) Spring Cloud Stream Applications is just not compatible with that Spring Integration version. You should not consider to upgrade to the latest (2.5.x) Spring Boot or consider to downgrade Spring Integration to 5.4.11. Another option is to use the latest 1.1.0-SNAPSHOT for that log-consumer and take its artifact from the https://repo.spring.io/ui/native/libs-snapshot/org/springframework/cloud/fn/log-consumer.

    We are looking about releasing Stream Applications 2021.0.0 these days ASAP.