使用 rabbitmq 云总线启动 Spring 云服务器的问题

Issue staring Spring cloud server with rabbitmq cloud bus

我正在使用控制总线 (rabbitmq) 配置 spring 配置服务器,但是当我添加它的依赖项时,应用程序无法启动并出现错误:

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.stream.binder.rabbit.RabbitMessageChannelBinder.createConsumerEndpoint(RabbitMessageChannelBinder.java:517)

The following method did not exist:

    'void org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter.<init>(org.springframework.amqp.rabbit.listener.AbstractMessageListenerContainer)'

The method's class, org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter, is available from the following locations:

    jar:file:/D:/maven/Repo/org/springframework/integration/spring-integration-amqp/5.5.2/spring-integration-amqp-5.5.2.jar!/org/springframework/integration/amqp/inbound/AmqpInboundChannelAdapter.class

The class hierarchy was loaded from the following locations:

    org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter: file:/D:/maven/Repo/org/springframework/integration/spring-integration-amqp/5.5.2/spring-integration-amqp-5.5.2.jar
    org.springframework.integration.endpoint.MessageProducerSupport: file:/D:/maven/Repo/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar
    org.springframework.integration.endpoint.AbstractEndpoint: file:/D:/maven/Repo/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar
    org.springframework.integration.context.IntegrationObjectSupport: file:/D:/maven/Repo/org/springframework/integration/spring-integration-core/5.5.2/spring-integration-core-5.5.2.jar


Action:

Correct the classpath of your application so that it contains a single, compatible version of org.springframework.integration.amqp.inbound.AmqpInboundChannelAdapter

使用spring云版本2020.0.3和spring启动版本 2.5.3 和我的 pom.xml 包含以下依赖项(不相关的已删除)

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-server</artifactId>
    </dependency>   

    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-config-monitor</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-bus-amqp</artifactId>

    </dependency>

这是一个已知问题;在 spring-integration-amqp 5.5.3 (Boot 2.5.4) 中修复。

https://github.com/spring-projects/spring-integration/issues/3606