Missing schema module for spring-cloud-stream

a 夏天 提交于 2019-12-12 01:13:40

问题


Trying to use the following example from Spring Docs

@Bean
public MessageConverter userMessageConverter() throws IOException {
  AvroSchemaMessageConverter avroSchemaMessageConverter {
  return new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes");
}

Using Gradle as follows

buildscript {
  ext {
    springBootVersion = '1.4.2.RELEASE'
  }
  dependencies {
    classpath("org.springframework.boot:spring-boot-gradle-plugin:${springBootVersion}")
  }
}

apply plugin: 'org.springframework.boot'

dependencies {
  compile('org.springframework.cloud:spring-cloud-stream')
  compile('org.springframework.cloud:spring-cloud-starter-stream-kafka')
}

dependencyManagement {
  imports {
    mavenBom "org.springframework.cloud:spring-cloud-dependencies:Camden.SR2"
  }
}

Gradle is loading the correct version of spring-cloud-streams 1.1.0.RELEASE but it does not match with the Github Repo. The artifact is missing the org.springframework.cloud.stream.schema package/source.

Am I missing something here?


回答1:


The artifact org.springframework.cloud:spring-cloud-starter-stream-kafka brings in spring-cloud-stream, spring-cloud-stream-codec and related dependencies like spring-integration. You would have to explicitly define org.springframework.cloud:spring-cloud-stream-schema.

Also, you don't need to specify 'org.springframework.cloud:spring-cloud-stream' as it will be part of org.springframework.cloud:spring-cloud-starter-stream-kafka via org.springframework.cloud:spring-cloud-stream-binder-kafka.



来源:https://stackoverflow.com/questions/40813184/missing-schema-module-for-spring-cloud-stream

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!