package com.qianwen.smartman.modules.notify.message.rocket.producer;
|
|
import org.apache.rocketmq.client.producer.SendCallback;
|
import org.apache.rocketmq.client.producer.SendResult;
|
import org.apache.rocketmq.spring.core.RocketMQTemplate;
|
import org.slf4j.Logger;
|
import org.slf4j.LoggerFactory;
|
import com.qianwen.core.notify.NotifyResultProducer;
|
import com.qianwen.core.notify.event.SerializableNotifierEvent;
|
import com.qianwen.smartman.modules.sync.constant.QyWechatConstant;
|
|
/* loaded from: blade-api.jar:BOOT-INF/classes/org/springblade/modules/notify/message/rocket/producer/RocketNotifyResultProducer.class */
|
public class RocketNotifyResultProducer implements NotifyResultProducer {
|
private static final Logger log = LoggerFactory.getLogger(RocketNotifyResultProducer.class);
|
private final RocketMQTemplate rocketMQTemplate;
|
|
public RocketNotifyResultProducer(final RocketMQTemplate rocketMQTemplate) {
|
this.rocketMQTemplate = rocketMQTemplate;
|
}
|
|
public boolean syncSend(SerializableNotifierEvent object) {
|
return false;
|
}
|
|
public void asyncSend(final SerializableNotifierEvent object) {
|
String topicWithTag = "notify-center-history-topic:" + (object.isSuccess() ? QyWechatConstant.CALLBACK_RESULT : "error");
|
this.rocketMQTemplate.asyncSend(topicWithTag, object, new SendCallback() { // from class: org.springblade.modules.notify.message.rocket.producer.RocketNotifyResultProducer.1
|
public void onSuccess(SendResult sendResult) {
|
RocketNotifyResultProducer.log.info("[RocketNotifyResultProducer][发送编号:[{}] 发送成功,结果为:[{}]]", object.toString(), sendResult);
|
}
|
|
public void onException(Throwable throwable) {
|
RocketNotifyResultProducer.log.info("[RocketNotifyResultProducer][发送编号:[{}] 发送异常]]", object.toString(), throwable);
|
}
|
});
|
}
|
}
|