From 3216ed3fb2d9dc9cf61da21bda3175e66ec46426 Mon Sep 17 00:00:00 2001 From: dengzedong <dengzedong@email> Date: 星期五, 06 十二月 2024 17:04:11 +0800 Subject: [PATCH] IailabClient 配置 --- shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicAlarmRabbitConfig.java | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicAlarmRabbitConfig.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicAlarmRabbitConfig.java new file mode 100644 index 0000000..da4f90e --- /dev/null +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/config/TopicAlarmRabbitConfig.java @@ -0,0 +1,37 @@ +package com.iailab.module.shasteel.mq.config; + +import com.iailab.module.shasteel.mq.consumer.AlarmMessage; +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 TopicAlarmRabbitConfig { + //绑定键 + public final static String routingAlarm = AlarmMessage.ALARM_ROUTING_KEY; + + @Bean + public Queue alarmQueue() { + return new Queue(TopicAlarmRabbitConfig.routingAlarm); + } + + @Bean + TopicExchange alarmExchange() { + return new TopicExchange(AlarmMessage.EXCHANGE); + } + + // 注意通配符*和#的用法 + @Bean + Binding bindingExchangeMessageAlarm() { + return BindingBuilder.bind(alarmQueue()).to(alarmExchange()).with(routingAlarm); + } +} -- Gitblit v1.9.3