使用 Kinesis 启动 Spring Cloud Stream 时出错

Error starting Spring Cloud Stream with Kinesis

我正在尝试使用进程 Kinesis Stream 启动一个新的示例项目,但我收到以下错误:

Exception in thread "-kinesis-consumer-1" java.lang.NoSuchFieldError: logger
    at org.springframework.integration.aws.inbound.kinesis.KinesisMessageDrivenChannelAdapter.access00(KinesisMessageDrivenChannelAdapter.java:100)
    at org.springframework.integration.aws.inbound.kinesis.KinesisMessageDrivenChannelAdapter$ShardConsumer.lambda$execute[=11=](KinesisMessageDrivenChannelAdapter.java:941)

这些是我的 pom 依赖项:

<dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream-binder-kinesis</artifactId>
        <version>LATEST</version>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-actuator</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-web</artifactId>
    </dependency>

    <dependency>
        <groupId>com.amazonaws</groupId>
        <artifactId>aws-java-sdk-kinesis</artifactId>
        <version>1.11.632</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-devtools</artifactId>
        <scope>runtime</scope>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-configuration-processor</artifactId>
        <optional>true</optional>
    </dependency>
    <dependency>
        <groupId>org.springframework.boot</groupId>
        <artifactId>spring-boot-starter-test</artifactId>
        <scope>test</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream</artifactId>
        <scope>test</scope>
        <classifier>test-binder</classifier>
        <type>test-jar</type>
    </dependency>
</dependencies>

Spring Cloud with Kinesis 的示例代码已过时,因此我尝试使用最新的依赖项。

无论如何,有人可以帮忙吗?

您可能尝试使用最新的 Spring 引导 2.4.x,它已经为我们带来 Spring 集成 5.4。而且这个不兼容最新的Spring Integration AWS,还是基于Spring Integration 5.3.x.

让我们看看您是否还能坚持 Spring 启动 2.3.x!