《一线大厂Java面试题解析+核心总结学习笔记+最新讲解视频+实战项目源码》,点击传送门,即可获取!
}
// /转发/
// @SendTo(/其他通道/)
// @StreamListener(/接受通道/)
// public String sendTo(Object o) {
// return “sendTo”;
// }
}
消息发送端
application.properties配置
#MQ
spring.rabbitmq.host=localhost
spring.rabbitmq.port=5672
spring.rabbitmq.username=admin
spring.rabbitmq.password=admin
#定义通道mqScoreOutput
spring.cloud.stream.bindings.mqScoreOutput.destination=exchangeName
#消息转换
spring.cloud.stream.bindings.mqScoreOutput.contentType=application/json
定义接口
/**
-
定义接口
-
@author 向振华
-
@date 2018/11/14 13:51
*/