From 8766cfc344d3635cd7e50a7c674cd5feb54d5a3d Mon Sep 17 00:00:00 2001 From: liriming <1343021927@qq.com> Date: 星期一, 02 十二月 2024 09:30:35 +0800 Subject: [PATCH] 预警mq监听并发送 --- shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicPredictFinishRabbitConfig.java | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicPredictFinishRabbitConfig.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicPredictFinishRabbitConfig.java new file mode 100644 index 0000000..c67a5b6 --- /dev/null +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicPredictFinishRabbitConfig.java @@ -0,0 +1,37 @@ +package com.iailab.module.shasteel.mq.config; + +import com.iailab.module.shasteel.mq.consumer.PredictFinishMessage; +import org.springframework.amqp.core.Binding; +import org.springframework.amqp.core.BindingBuilder; +import org.springframework.amqp.core.Queue; +import org.springframework.amqp.core.TopicExchange; +import org.springframework.context.annotation.Bean; +import org.springframework.context.annotation.Configuration; + +/** + * @author lirm + * @Description + * @createTime 2024年11月27日 + */ +@Configuration +public class TopicPredictFinishRabbitConfig { + //绑定键 + public final static String routingPredictFinish = PredictFinishMessage.PREDICTFINISH_ROUTING_KEY; + + @Bean + public Queue predictFinishQueue() { + return new Queue(TopicPredictFinishRabbitConfig.routingPredictFinish); + } + + + @Bean + TopicExchange exchange() { + return new TopicExchange(PredictFinishMessage.EXCHANGE); + } + + // 注意通配符*和#的用法 + @Bean + Binding bindingExchangeMessageDH() { + return BindingBuilder.bind(predictFinishQueue()).to(exchange()).with(routingPredictFinish); + } +} -- Gitblit v1.9.3