芋道源码 - 连接消息队列 rabbitmq
1. 未连接rabbitmq
项目配置未打开之前是没有任何连接的
2. 连接步骤
2.1 application.yml
websocket:enable: true # websocket的开关, true, falsepath: /infra/ws # 路径sender-type: rabbitmq # 消息发送的类型,可选值为 local、redis、rocketmq、kafka、rabbitmqsender-rocketmq:topic: ${spring.application.name}-websocket # 消息发送的 RocketMQ Topicconsumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 RocketMQ Consumer Groupsender-rabbitmq:exchange: ${spring.application.name}-websocket-exchange # 消息发送的 RabbitMQ Exchangequeue: ${spring.application.name}-websocket-queue # 消息发送的 RabbitMQ Queuesender-kafka:topic: ${spring.application.name}-websocket # 消息发送的 Kafka Topicconsumer-group: ${spring.application.name}-websocket-consumer # 消息发送的 Kafka Consumer Group
websocket的开关: true
sender-type: rabbitmq
websocket连接端点: /infra/ws
2.2 pom文件
yudao-framework 下的 yudao-spring-boot-starter-websocket
<!-- 注释掉optional -->
<dependency><groupId>org.springframework.amqp</groupId><artifactId>spring-rabbit</artifactId>
<!--<optional>true</optional>-->
</dependency>
yudao-module-system 下的 yudao-module-system-biz
<!--新增websocket关联-->
<dependency><groupId>cn.iocoder.boot</groupId><artifactId>yudao-spring-boot-starter-websocket</artifactId>
</dependency>