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; - } -}