feat:合并代码
This commit is contained in:
parent
9604499119
commit
a50a9bdb0e
@ -34,9 +34,12 @@ public class EventProduceTemplate {
|
||||
}
|
||||
|
||||
public void send(String topic, Serializable message, String tag) {
|
||||
send(topic, defaultModule, defaultName, message, null, null, null, tag);
|
||||
send(topic, defaultModule, defaultName, message, null, null, null, tag, false);
|
||||
}
|
||||
|
||||
public void transactionalSend(String topic, Serializable message, String tag, Boolean transactional) {
|
||||
send(topic, defaultModule, defaultName, message, null, null, null, tag, transactional);
|
||||
}
|
||||
|
||||
public void send(String topic, Serializable message) {
|
||||
send(topic, message, null);
|
||||
@ -65,7 +68,7 @@ public class EventProduceTemplate {
|
||||
* targetType 事件目标类型 例如:user-create ,可用于过滤数据
|
||||
*/
|
||||
public void sendShardingMsg(String topic, Serializable message, String shardingKey, String targetId, String targetType, String tag) {
|
||||
send(topic, defaultModule, defaultName, message, shardingKey, targetId, targetType, tag);
|
||||
send(topic, defaultModule, defaultName, message, shardingKey, targetId, targetType, tag, false);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -78,18 +81,20 @@ public class EventProduceTemplate {
|
||||
* message 消息内容 ,必填
|
||||
*/
|
||||
public void send(String topic, String module, String name, Serializable message, String shardingKey, String targetId, String targetType) {
|
||||
send(topic, module, name, message, shardingKey, targetId, targetType, null);
|
||||
send(topic, module, name, message, shardingKey, targetId, targetType, null, false);
|
||||
}
|
||||
|
||||
public void send(String topic, String module, String name, Serializable message, String shardingKey, String targetId, String targetType, String tag) {
|
||||
public void send(String topic, String module, String name, Serializable message, String shardingKey, String targetId, String targetType, String tag, Boolean transactional) {
|
||||
//检查参数
|
||||
checkParam(topic, message);
|
||||
Event.EventCode eventCode = new Event.EventCode(module, name);
|
||||
EventProducer.Context content = EventProducer.Context.<RocketMQEventProducer.RocketMQMessageMeta>builder()
|
||||
.meta(RocketMQEventProducer.RocketMQMessageMeta.builder()
|
||||
.topic(topic)
|
||||
.tag(tag)
|
||||
.build()).build();
|
||||
.meta(RocketMQEventProducer.RocketMQMessageMeta.builder()
|
||||
.topic(topic)
|
||||
.tag(tag)
|
||||
.build())
|
||||
.transactional(transactional)
|
||||
.build();
|
||||
|
||||
if (StringUtils.isEmpty(targetType)) {
|
||||
targetType = topic;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user