feat(mq): 新增 WebAI 消息队列支持

为支持 WebAI 登录场景,新增 web.ai.headers.exchange 交换机及对应发送方法;
在 HostInfoServiceImpl 中增加 Redis 前缀判断与 webAISend 调用逻辑。
This commit is contained in:
2025-12-05 13:57:34 +08:00
parent 9f062492c4
commit cf15298968
3 changed files with 26 additions and 0 deletions

View File

@@ -24,6 +24,9 @@ public class RabbitMQConfig {
public static final String AI_CHAT_EXCHANGE_NAME = "ai.chat.headers.exchange";
public static final String BIG_BROTHER_EXCHANGE_NAME = "big.brother.headers.exchange";
public static final String WEB_AI_EXCHANGE_NAME = "web.ai.headers.exchange";
//创建队列
//true:表示持久化
@@ -63,6 +66,13 @@ public class RabbitMQConfig {
.build();
}
@Bean
public HeadersExchange webAiHeadersExchange() {
return ExchangeBuilder.headersExchange(WEB_AI_EXCHANGE_NAME)
.durable(true)
.build();
}
@Bean
public RabbitAdmin rabbitAdmin(ConnectionFactory cf) {