首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >弹簧云流粘合剂卡夫卡不起作用

弹簧云流粘合剂卡夫卡不起作用
EN

Stack Overflow用户
提问于 2019-06-05 11:06:43
回答 1查看 887关注 0票数 0

现在,我尝试用kafka创建Message函数来使用spring-cloud-stream-bind-kafka,但效果不太好。

Configuration:

弹簧引导1.4.2

build.gradle:

代码语言:javascript
复制
compile "org.springframework.cloud:spring-cloud-stream:2.0.1.RELEASE"
compile "org.springframework.cloud:spring-cloud-stream-binder-kafka:2.0.1.RELEASE"

code:

代码语言:javascript
复制
@EnableBindings(MessagePublish.class)
class MessageConfiguration {
}

interface MessagePublish {
    @Output("test")
    MessageChannel publish();
}

class TestService {
    @Autowired
    MessagePublish messagePublish;

    public void doSomething() {
        // do something
        messagePublish.publish().send(MessageBuilder.withPayload("test").build());
    }
}

当我用此错误日志启动项目时,它失败了

代码语言:javascript
复制
Caused by: org.springframework.boot.autoconfigure.condition.OnBeanCondition$BeanTypeDeductionException: Failed to deduce bean type for org.springframework.cloud.stream.config.BindingServiceConfiguration.bindingService
....
Caused by: java.lang.ClassNotFoundException: org.springframework.integration.support.converter.ConfigurableCompositeMessageConverter

我怀疑我的春靴版本。太低了。

我认为spring-cloud-stream-binder-kafka不能在SpringBoot2.0版本或其他原因下使用。

我不知道我该怎么做,我如何去探索这种情况.

如果你给我一点建议,我真的很感激你。

EN

回答 1

Stack Overflow用户

回答已采纳

发布于 2019-06-05 12:35:52

如果您正在使用Spring 1.4.x版本,那么您应该使用Spring发行版。

https://github.com/spring-projects/spring-cloud/wiki/Spring-Cloud-Camden-Release-Notes

特别是,您应该使用以下版本:

代码语言:javascript
复制
compile "org.springframework.cloud:spring-cloud-stream:1.1.2.RELEASE"
compile "org.springframework.cloud:spring-cloud-stream-binder-kafka:1.1.2.RELEASE"
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/56459270

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档