0

我在 spring-cloud-stream-schema - 1.2.0.RC1 中缺少 AvroSchemaMessageConverter 类。我想通过这个链接Missing schema module for spring-cloud-stream

  <dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-stream-schema</artifactId>
    <version>1.2.0.RC1</version>
  </dependency>

当我查看pom.xml时,我预计AvroSchemaMessageConverter.java类将在spring-cloud-stream-1.2.0.RC1.jar 中可用。但它不存在,如下图所示:

Eclipse Spring 依赖项

有人可以指出我缺少的依赖项。我对 spring-cloud-stream 的 Maven 依赖项发布到 Kafka 主题。

    <dependencyManagement>
      <dependencies>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-dependencies</artifactId>
            <version>Dalston.RC1</version>
            <type>pom</type>
            <scope>import</scope>
        </dependency>
      </dependencies>
    </dependencyManagement>
    <dependencies>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-starter-stream-kafka</artifactId>
    </dependency>
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream-binder-kafka</artifactId>
        <exclusions>
          <exclusion>
            <groupId>org.apache.kafka</groupId>
            <artifactId>kafka_2.11</artifactId>
          </exclusion>
        </exclusions>
    </dependency>
    <!-- Apache avro serialization support  -->
    <dependency>
        <groupId>org.springframework.cloud</groupId>
        <artifactId>spring-cloud-stream-schema</artifactId>
    </dependency>
    </dependencies>
4

2 回答 2

2

它在模式 jar 中:

<!-- Apache avro serialization support  -->
<dependency>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-stream-schema</artifactId>
</dependency>

请注意该 GitHub 工件的完整层次结构......

spring-cloud-stream/spring-cloud-stream-schema/src/main/java/org/springframework/cloud/stream/schema/avro/AvroSchemaMessageConverter.java
于 2017-04-03T18:16:19.333 回答
1

您发布的链接明确提到您需要包含org.springframework.cloud:spring-cloud-stream-schema, where AvroSchemaMessageConverterliving。您还需要明确添加 Avro 版本。

于 2017-04-03T18:16:02.070 回答