SerializationFailedException:具有kpl-kcl-enabled:true的Spring Cloud Stream Kinesis绑定程序:true

问题描述 投票:0回答:1

我目前正在评估在新项目中使用春季云流运动学绑定器的可能性,但是我遇到了一些问题。

当我启用了kcl-kpl时:false一切正常。但是,当我启用了kcl-kop时,会不断出现以下错误:

org.springframework.core.serializer.support.SerializationFailedException: Failed to deserialize payload. Is the byte array a result of corresponding serialization for DefaultDeserializer?; nested exception is java.io.StreamCorruptedException: invalid stream header: 61686868

这是我当前的配置:

spring:
  cloud:
    stream:
      kinesis:
        binder:
          checkpoint:
            create-delay: 0
            table: feeder_mycollection_changes_table
          kpl-kcl-enabled: true
        bindings:
          processEvent-in-0:
            consumer:
              shardIteratorType: TRIM_HORIZON
      bindings:
        processEvent-in-0:
          destination: mycollection_changes_stream
          content-type: application/json
          consumer:
            headerMode: none

我在测试中使用的依赖项的版本是:

<spring-cloud.version>Hoxton.RC2</spring-cloud.version>
<spring-cloud-stream.version>Horsham.RC2</spring-cloud-stream.version>
<spring-cloud-stream-kinesis.version>2.0.0.BUILD-SNAPSHOT</spring-cloud-stream-kinesis.version>
spring-cloud-stream spring-integration-aws
1个回答
0
投票

解决方法在这里:https://github.com/spring-cloud/spring-cloud-stream-binder-aws-kinesis/commit/b64cd10c5b5aac209b61399f81e2801f24fbbaf4

问题是converter中的默认KclMessageDrivenChannelAdapterDeserializingConverter

Spring Cloud Stream不处理Java序列化,它具有自己的转换byte[]的机制。因此,我们需要修复一个Binder实现,以依赖于Spring Cloud Stream转换基础结构。

© www.soinside.com 2019 - 2024. All rights reserved.