From c332098ee5fda10eee61f2a94fe462a05c08f0ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=91=A8=E6=95=8F?= Date: Tue, 20 Aug 2024 10:17:14 +0800 Subject: [PATCH] =?UTF-8?q?feat(REQ-2649):=20=E7=A7=BB=E9=99=A4=E4=B8=80?= =?UTF-8?q?=E4=B8=AA=E9=87=8D=E5=A4=8D=E5=AE=9A=E4=B9=89=E7=9A=84MQConfig?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../server/mq/RocketMQEventConfiguration.java | 50 ------------------- 1 file changed, 50 deletions(-) delete mode 100644 black-list/black-list-service/src/main/java/cn/axzo/nanopart/server/mq/RocketMQEventConfiguration.java diff --git a/black-list/black-list-service/src/main/java/cn/axzo/nanopart/server/mq/RocketMQEventConfiguration.java b/black-list/black-list-service/src/main/java/cn/axzo/nanopart/server/mq/RocketMQEventConfiguration.java deleted file mode 100644 index 5e38379b..00000000 --- a/black-list/black-list-service/src/main/java/cn/axzo/nanopart/server/mq/RocketMQEventConfiguration.java +++ /dev/null @@ -1,50 +0,0 @@ -package cn.axzo.nanopart.server.mq; - -import cn.axzo.framework.rocketmq.EventProducer; -import cn.axzo.framework.rocketmq.RocketMQEventProducer; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.StringUtils; -import org.apache.rocketmq.spring.core.RocketMQTemplate; -import org.springframework.beans.factory.annotation.Value; -import org.springframework.context.annotation.Bean; -import org.springframework.stereotype.Component; - -/** - * @Author zr - * @Date 2024/3/21 14:12 - * @Description - **/ -@Slf4j -@Component -public class RocketMQEventConfiguration { - - @Value("${spring.profiles.active}") - private String profileActivity; - private final String serviceName = "nanopart"; - private final String topic = "nanopart"; - - @Bean - public RocketMQTemplate ser(){ - return new RocketMQTemplate(); - } - @Bean - EventProducer eventProducer(RocketMQTemplate rocketMQTemplate) { - return new RocketMQEventProducer(rocketMQTemplate, - serviceName, - serviceName, - EventProducer.Context.builder() - .meta(RocketMQEventProducer.RocketMQMessageMeta.builder() - .topic(getTopic(topic)) - .build()) - .build(), - null - ); - } - - private String getTopic(String topic) { - if (!StringUtils.isEmpty(topic)) { - topic = "topic_"+topic + "_" + profileActivity; - } - return topic; - } -}