修复打包失败
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m38s
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 12m38s
This commit is contained in:
@@ -1,65 +1,65 @@
|
||||
package org.dromara.sis.rocketmq.producer;
|
||||
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.rocketmq.common.message.Message;
|
||||
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.beans.factory.annotation.Qualifier;
|
||||
import org.springframework.stereotype.Component;
|
||||
|
||||
/**
|
||||
* @author lsm
|
||||
* @apiNote ProducerService
|
||||
* @since 2025/8/26
|
||||
*/
|
||||
@Slf4j
|
||||
@Component
|
||||
public class ProducerService {
|
||||
|
||||
@Autowired
|
||||
@Qualifier("rocketMQTemplateClusterOne")
|
||||
private RocketMQTemplate rocketMQTemplateClusterOne;
|
||||
|
||||
//package org.dromara.sis.rocketmq.producer;
|
||||
//
|
||||
//import lombok.extern.slf4j.Slf4j;
|
||||
//import org.apache.rocketmq.common.message.Message;
|
||||
//import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
||||
//import org.springframework.beans.factory.annotation.Autowired;
|
||||
//import org.springframework.beans.factory.annotation.Qualifier;
|
||||
//import org.springframework.stereotype.Component;
|
||||
//
|
||||
///**
|
||||
// * @author lsm
|
||||
// * @apiNote ProducerService
|
||||
// * @since 2025/8/26
|
||||
// */
|
||||
//@Slf4j
|
||||
//@Component
|
||||
//public class ProducerService {
|
||||
//
|
||||
// @Autowired
|
||||
// @Qualifier("rocketMQTemplateClusterTwo")
|
||||
// private RocketMQTemplate rocketMQTemplateClusterTwo;
|
||||
|
||||
/**
|
||||
* 向mq写入消息
|
||||
*
|
||||
* @param topic 消息topic
|
||||
* @param tag 消息tag
|
||||
* @param msg 消息
|
||||
*/
|
||||
public void defaultSend(String topic, String tag, String msg) {
|
||||
try {
|
||||
String destination = topic + ":" + tag;
|
||||
// 使用 RocketMQTemplate 的同步发送方法
|
||||
rocketMQTemplateClusterOne.syncSend(destination, msg);
|
||||
|
||||
log.info("发送RocketMQOne消息成功, nameServer:{}", rocketMQTemplateClusterOne.getProducer().getNamesrvAddr());
|
||||
} catch (Exception e) {
|
||||
log.error("发送RocketMQOne消息失败", e);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 向mq写入消息
|
||||
*
|
||||
* @param topic 消息topic
|
||||
* @param tag 消息tag
|
||||
* @param msg 消息
|
||||
*/
|
||||
// public void clusterSend(String topic, String tag, String msg) {
|
||||
// @Qualifier("rocketMQTemplateClusterOne")
|
||||
// private RocketMQTemplate rocketMQTemplateClusterOne;
|
||||
//
|
||||
//// @Autowired
|
||||
//// @Qualifier("rocketMQTemplateClusterTwo")
|
||||
//// private RocketMQTemplate rocketMQTemplateClusterTwo;
|
||||
//
|
||||
// /**
|
||||
// * 向mq写入消息
|
||||
// *
|
||||
// * @param topic 消息topic
|
||||
// * @param tag 消息tag
|
||||
// * @param msg 消息
|
||||
// */
|
||||
// public void defaultSend(String topic, String tag, String msg) {
|
||||
// try {
|
||||
// String destination = topic + ":" + tag;
|
||||
// // 使用 RocketMQTemplate 的同步发送方法
|
||||
// rocketMQTemplateClusterTwo.syncSend(destination, msg);
|
||||
// rocketMQTemplateClusterOne.syncSend(destination, msg);
|
||||
//
|
||||
// log.info("发送RocketMQTwo消息成功, nameServer:{}", rocketMQTemplateClusterTwo.getProducer().getNamesrvAddr());
|
||||
// log.info("发送RocketMQOne消息成功, nameServer:{}", rocketMQTemplateClusterOne.getProducer().getNamesrvAddr());
|
||||
// } catch (Exception e) {
|
||||
// log.error("发送RocketMQTwo消息失败", e);
|
||||
// log.error("发送RocketMQOne消息失败", e);
|
||||
// }
|
||||
// }
|
||||
}
|
||||
//
|
||||
//
|
||||
// /**
|
||||
// * 向mq写入消息
|
||||
// *
|
||||
// * @param topic 消息topic
|
||||
// * @param tag 消息tag
|
||||
// * @param msg 消息
|
||||
// */
|
||||
//// public void clusterSend(String topic, String tag, String msg) {
|
||||
//// try {
|
||||
//// String destination = topic + ":" + tag;
|
||||
//// // 使用 RocketMQTemplate 的同步发送方法
|
||||
//// rocketMQTemplateClusterTwo.syncSend(destination, msg);
|
||||
////
|
||||
//// log.info("发送RocketMQTwo消息成功, nameServer:{}", rocketMQTemplateClusterTwo.getProducer().getNamesrvAddr());
|
||||
//// } catch (Exception e) {
|
||||
//// log.error("发送RocketMQTwo消息失败", e);
|
||||
//// }
|
||||
//// }
|
||||
//}
|
||||
|
Reference in New Issue
Block a user