(Spring Cloud微服务实战-书中之坑)spring cloud Stream注入绑定接口报错bean definition with this name already exists
2019-05-15 19:08
337 查看
一、需求,在一个服务内,消息发送和消息接收
二、根据网上或者书中处理如下:
三、结果:报错,
Invalid bean definition with name ‘input’ defined in XXXX.SinkSender: bean definition with this name already exists
四、分析原因
上图可以看出,@EnableBinding的Sink.class和SinkSender.class中,@Input和@Output都定义了名称相同的Sink.INPUT导致
五、处理方式
application.yml修改如下:
spring:
cloud:
stream:
bindings:
input:
destination: raw-sensor-data
output:
destination: raw-sensor-data
SinkSender修改如下:
相关文章推荐
- (Spring Cloud微服务实战-书中之坑)spring cloud Stream注入绑定接口报错bean definition with this name already exists
- 微服务实战之春云与刀客(二)—— Spring cloud 实现仿RPC面向接口调用方式
- SpringCloud微服务实战之消息驱动Stream
- SpringCLoud实战微服务之——微服务简介以及入门使用
- Spring Cloud微服务实战-2017年3月
- 170925_Spring Cloud 微服务实战(翟永超著) 读书笔记(二)_什么是Spring Cloud Eureka?
- 微服务Spring Cloud实战教程附源码讲义完整版 53课
- Spring Cloud实战之初级入门(四)— 利用Hystrix实现服务熔断与服务监控
- Spring Cloud微服务实战---1.4.JPA与JDBC协同
- Spring Cloud微服务实战---1.8.Eureka下的服务调用
- spring cloud 微服务实战开篇
- SpringCloud Finchley 实战入门(基于springBoot 2.0.3)【四 Ribbon 服务负载均衡】
- 7周Spring Cloud微服务架构项目实战
- SpringCloud微服务知识整理十:消息驱动的微服务:Spring Cloud Stream
- Spring Cloud微服务实战阅读笔记(一) 基础知识
- Spring Cloud 分布式微服务架构 企业级实战 :一、项目构建
- Spring Cloud微服务实战(1)—基础知识
- SpringCloud Finchley 实战入门(基于springBoot 2.0.3)【二 服务治理 Eureka】
- [Spring Cloud Stream]1 流式微服务核心概念
- SpringCloud微服务实战之断路器Hystrix