发送的消息主题是output而不是stream-test-topic
来源:9-15 Spring Cloud Stream-编写生产者

L灬Lawliet
2019-08-15
配置文件如图
写回答
1回答
-
您好,视频中的配置如下:
stream: rocketmq: binder: name-server: 127.0.0.1:9876 bindings: output: producer: transactional: true group: tx-add-bonus-group bindings: output: # 用来指定topic destination: add-bonus
视频中用的是xxx.bindings.output.destination,你用的是xxx.binders.output.destination。
你的配置根本不存在,所以配置不会生效,于是,Spring Cloud Stream使用了channel的名称(output)作为topic了。
建议:
Stream的配置是比较复杂的,binder/binding啥的一定要区分好。建议对比视频里的配置,并且根据课上介绍的binding、binder分别的作用,猜测配置是放在哪块;
建议用IDEA或者spring tool suite,否则IDE没有提示的话,你会很蛋疼的。一来工作效率很低,都得自己手写;二来还可能抄错……
012019-08-15
相似问题