问题描述
尝试使用以下 示例来自 Spring文档
@Bean
public MessageConverter userMessageConverter() throws IOException {
AvroSchemaMessageConverter avroSchemaMessageConverter {
return new AvroSchemaMessageConverter(MimeType.valueOf("avro/bytes");
}
使用 Gradle 如下
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 正在加载正确版本的 spring-cloud-streams 1.1.0.RELEASE
但它与 Github Repo.该工件缺少 org.springframework.cloud.stream.schema
包/源.
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?
推荐答案
org.springframework.cloud:spring-cloud-starter-stream-kafka
带来的神器 spring-cloud-stream
、spring-cloud-stream-codec
和相关的依赖,如 spring-integration
.您必须明确定义 org.springframework.cloud:spring-cloud-stream-schema
.
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
.
此外,您不需要指定org.springframework.cloud:spring-cloud-stream",因为它将成为org.springframework.cloud:spring-cloud-starter-stream-kafka
通过 org.springframework.cloud:spring-cloud-stream-binder-kafka
.
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
.
这篇关于缺少 spring-cloud-stream 的架构模块的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!