1.看官方文档
https://www.rabbitmq.com/api-guide.html#publishing
2.连接Connection connection
官方文档是说:属于长连接,所以没必要每次发送消息都 重新建立连接然后断开连接,申明全局变量,然后在线程中实例化
3.channel
通道建议不要使用同一个
05-29
409
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
09-15
3237
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)
05-30
“相关推荐”对你有帮助么?
-
非常没帮助
-
没帮助
-
一般
-
有帮助
-
非常有帮助
提交