【问题标题】:spring-integration-kafka 1.3.1.RELEASE : Any workaround to use org.apache.kafka.common.serialization?spring-integration-kafka 1.3.1.RELEASE:使用 org.apache.kafka.common.serialization 的任何解决方法?
【发布时间】:2017-10-09 17:03:42
【问题描述】:

我正在使用 Spring XD 来解决这个问题:

是否有任何解决方法可以反序列化我从 Kafka 主题(0.9 版)收到的消息。

我一直在尝试修改依赖项以保持 spring-integration-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>

当我在部署流时运行我的流(假设是一个 kafka 源 | 日志),我得到了这个:

16:49:43,171 WARN DeploymentsPathChildrenCache-0 utils.VerifiableProperties - 属性 key.deserializer 无效 16:49:43,172 WARN DeploymentsPathChildrenCache-0 utils.VerifiableProperties - 属性 value.deserializer 无效

显然:

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

【问题讨论】:

    标签: spring serialization apache-kafka spring-integration spring-xd


    【解决方案1】:

    Spring XD 使用的是旧版本的 Spring Integration Kafka (1.x),只支持 0.8.x.x 的 kafka 客户端。

    Spring Integration Kafka 2.x 支持 0.9.x.x -> 0.10.2.x;它基于 spring-kafka 项目。

    您需要基于较新的 Spring Integration 模块创建自定义源。

    2.1.0.RELEASE 应该适用于 spring-kafka 1.2.x 和 0.10.2.x 客户端。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2016-04-14
      • 2020-07-25
      • 2019-04-16
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2018-08-28
      相关资源
      最近更新 更多