【问题标题】:Spring Integration Kafka not working春季集成卡夫卡不工作
【发布时间】:2017-05-19 12:06:27
【问题描述】:

我正在尝试使用 Kafka 和 Spring Boot 探索 Spring Integration。我正在关注本教程Spring Integration and Kafka

我正在使用该文档中提供的依赖项,但出现以下异常

Caused by: org.xml.sax.SAXParseException: cvc-complex-type.3.2.2: Attribute 'compression-codec' is not allowed to appear in element 'int-kafka:producer-configuration'.

我认为这是一个 jar 不匹配问题,但我无法解决它,我试图更改很多版本,但组合对我不起作用。请在下面找到我的 gradle 依赖项。

compile('org.springframework.boot:spring-boot-starter-integration')
compile('org.springframework.boot:spring-boot-starter')
compile('org.apache.kafka:kafka_2.10:0.8.1.1')
compile('org.springframework.integration:spring-integration-kafka:2.1.0.RELEASE')
compile('org.springframework.integration:spring-integration-java-dsl:1.1.0.M1') 

如果您需要关于此的更多详细信息,请告诉我。

【问题讨论】:

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


    【解决方案1】:

    那是一篇很老的文章,基于 1.x 版本;配置发生了很大变化 - 请参阅 spring-kafka 参考手册中更新的 Spring Integration Kafka 文档。

    Spring Integration Kafka (2.x) 现在基于 Spring Kafka 项目。

    http://projects.spring.io/spring-kafka/

    还有一个sample application,但它使用 Java 配置,而不是 XML。

    【讨论】:

    • 谢谢 Gary,我已经更新了 jar 的版本并且它工作正常,粘贴了我使用的依赖项。
    【解决方案2】:

    我使用了以下依赖项并且它们有效。

    compile('org.springframework.boot:spring-boot-starter')
    compile('org.springframework.integration:spring-integration-stream')
    compile('org.springframework.integration:spring-integration-kafka:2.1.0.RELEASE')
    compile('org.springframework.integration:spring-integration-java-dsl:1.1.0.M1')
    

    【讨论】:

      猜你喜欢
      • 2015-06-18
      • 1970-01-01
      • 2022-01-16
      • 2021-11-30
      • 2018-01-15
      • 1970-01-01
      • 1970-01-01
      • 2019-11-17
      • 2018-03-13
      相关资源
      最近更新 更多