From 8b2191df2f7d94aa299bd43dcbe97c94e5a61bbd Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期三, 20 十一月 2019 14:53:34 +0800 Subject: [PATCH] RocketMQ的消息整改 --- fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java | 9 +++++---- 1 files changed, 5 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java index 9ae2f27..cf0dac1 100644 --- a/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java +++ b/fanli/src/main/java/com/yeshi/fanli/service/impl/user/UserSystemCouponServiceImpl.java @@ -84,6 +84,7 @@ import com.yeshi.fanli.util.annotation.RequestSerializableByKeyService; import com.yeshi.fanli.util.factory.UserMoneyDetailFactory; import com.yeshi.fanli.util.factory.msg.MsgOtherSystemGiveDTOFactory; +import com.yeshi.fanli.util.rocketmq.MQMsgBodyFactory; import com.yeshi.fanli.util.rocketmq.MQTopicName; import com.yeshi.fanli.util.taobao.TaoBaoUtil; import com.yeshi.fanli.vo.msg.ClientTextStyleVO; @@ -896,8 +897,8 @@ UserSystemCouponUseMQMsg mqMsg = new UserSystemCouponUseMQMsg(userSystemCoupon.getId(), order.getOrderId(), sourceType, systemCoupon.getType().name()); // 浜嬪姟娑堟伅 - Message msg = new Message(MQTopicName.TOPIC_USER.name(), UserTopicTagEnum.useSystemCoupon.name(), - new Gson().toJson(mqMsg).getBytes()); + Message msg =MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.useSystemCoupon, + mqMsg); try { SendResult result = orderTransactionProducer.send(msg, new LocalTransactionExecuter() { @Override @@ -2082,8 +2083,8 @@ UserSystemCouponUseMQMsg msg = new UserSystemCouponUseMQMsg(); msg.setUserSystemCouponId(id); msg.setCouponType(type.name()); - Message message = new Message(MQTopicName.TOPIC_USER.name(), UserTopicTagEnum.systemCouponDrawback.name(), - new Gson().toJson(msg).getBytes()); + Message message = MQMsgBodyFactory.create(MQTopicName.TOPIC_USER, UserTopicTagEnum.systemCouponDrawback, + msg); try { producer.send(message); } catch (Exception e) { -- Gitblit v1.8.0