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/consumer/AlarmConsumer.java | 37 +++++++++++++++++++++++++++++++++++++ 1 files changed, 37 insertions(+), 0 deletions(-) diff --git a/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/AlarmConsumer.java b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/AlarmConsumer.java new file mode 100644 index 0000000..af5c1c3 --- /dev/null +++ b/shasteel-biz/src/main/java/com/iailab/module/shasteel/mq/consumer/AlarmConsumer.java @@ -0,0 +1,37 @@ +package com.iailab.module.shasteel.mq.consumer; + +import com.alibaba.fastjson.JSONObject; +import com.iailab.framework.common.util.date.DateUtils; +import com.iailab.module.model.api.mcs.McsApi; +import com.iailab.module.model.api.mcs.dto.AlarmConfigRespDTO; +import com.iailab.module.model.api.mcs.dto.AlarmMessageRespDTO; +import com.iailab.module.model.api.mcs.dto.PreDataJsonReqVO; +import org.springframework.amqp.rabbit.annotation.RabbitHandler; +import org.springframework.amqp.rabbit.annotation.RabbitListener; +import org.springframework.amqp.rabbit.core.RabbitTemplate; +import org.springframework.stereotype.Component; +import org.springframework.util.CollectionUtils; + +import javax.annotation.Resource; +import java.math.BigDecimal; +import java.util.ArrayList; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author lirm + * @Description + * @createTime 2024年11月27日 + */ +@Component +@RabbitListener(queues = AlarmMessage.ALARM_ROUTING_KEY) +public class AlarmConsumer { + + @Resource + private RabbitTemplate rabbitTemplate; + + public void process(AlarmMessage alarmMessage) throws InterruptedException { + rabbitTemplate.convertAndSend(AlarmMessage.EXCHANGE, AlarmMessage.ALARM_ROUTING_KEY, alarmMessage); + } +} -- Gitblit v1.9.3