spring集成kafka 1.3.1.release:有没有使用org.apache.kafka.common.serialization的变通方法?

edqdpe6u  于 2021-06-08  发布在  Kafka
关注(0)|答案(1)|浏览(289)

我使用spring xd来处理这个问题:
有没有解决方法来反序列化我从Kafka主题(0.9版本)收到的消息。
我一直在尝试修改依赖项以保持spring集成kafka 1.3.1,并使用最新的apache依赖项进行序列化

<dependency>
        <groupId>org.springframework.integration</groupId>
        <artifactId>spring-integration-kafka</artifactId>
        <exclusions>
            <exclusion>
                <groupId>org.apache.kafka</groupId>
                <artifactId>kafka-clients</artifactId>
            </exclusion>
            <exclusion>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.10</artifactId>
            </exclusion>
        </exclusions>
    </dependency>

    <dependency>
        <groupId>org.springframework.kafka</groupId>
        <artifactId>spring-kafka</artifactId>
        <version>1.2.0.RELEASE</version>
        <scope>compile</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.kafka</groupId>
        <artifactId>kafka-clients</artifactId>
        <version>0.10.2.0</version>
        <scope>provided</scope>
    </dependency>

当我运行我的流(asuming a kafka source | log)时,当它被部署时,我得到如下结果:
16:49:43171警告deploymentspathchildrencache-0 utils.verifiableproperties-属性键。反序列化程序无效16:49:43172警告deploymentspathchildrencache-0 utils.verifiableproperties-属性值。反序列化程序无效
显然:

2017-05-10T16:50:43-0400 1.3.0.RELEASE INFO task-scheduler-8 sink.probando_deserializer - {probando_topic={0=[[B@6fbfdb37]}}
o3imoua4

o3imoua41#

SpringXD使用了旧版本的SpringIntegrationKafka(1.x),它只支持0.8.x.xKafka客户端。
spring集成kafka 2.x支持0.9.x.x->0.10.2.x;它是基于 Spring Kafka项目。
您需要基于较新的spring集成模块创建一个自定义源代码。
2.1.0版本应该可以与SpringKafka1.2.x和0.10.2.x客户端一起使用。

相关问题