From 5e8907f1797a0f2028ab0731755941cf9ff7fc08 Mon Sep 17 00:00:00 2001 From: admin <2780501319@qq.com> Date: 星期六, 02 十一月 2019 00:29:27 +0800 Subject: [PATCH] RocketMQ消息实体改造 --- fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-) diff --git a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java index 469a4cf..55610dc 100644 --- a/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java +++ b/fanli/src/main/java/com/yeshi/fanli/util/rocketmq/consumer/order/InviteOrderSubsidyMessageListener.java @@ -22,6 +22,7 @@ import com.yeshi.fanli.exception.money.OrderMoneySettleException; import com.yeshi.fanli.exception.mq.MQUnSendInfoException; import com.yeshi.fanli.exception.order.InviteOrderSubsidyException; +import com.yeshi.fanli.log.LogHelper; import com.yeshi.fanli.service.inter.mq.MQUnSendInfoService; import com.yeshi.fanli.service.inter.order.InviteOrderSubsidyService; import com.yeshi.fanli.service.inter.order.OrderMoneySettleService; @@ -59,9 +60,11 @@ @Override public Action consume(Message message, ConsumeContext context) { - if (!Constant.IS_TASK) {// 闈炰换鍔℃湇鍔″櫒涓嶈兘娑堣垂娑堟伅 - return Action.ReconsumeLater; - } + // if (!Constant.IS_TASK) {// 闈炰换鍔℃湇鍔″櫒涓嶈兘娑堣垂娑堟伅 + // return Action.ReconsumeLater; + // } + LogHelper.mqInfo("consumer:InviteOrderSubsidyMessageListener", message.getTopic(), message.getTag(), + new String(message.getBody())); if (MQTopicName.TOPIC_ORDER.name().equalsIgnoreCase(message.getTopic())) { // 鏌ヨ涓婄骇绾㈠寘 @@ -148,7 +151,7 @@ Message msg = new Message(MQTopicName.TOPIC_FANLI.name(), "delay", new Gson().toJson(dto).getBytes()); msg.setKey(dto.getSourceType() + "_" + dto.getOrderId()); - long delayTime = System.currentTimeMillis() + 1000 * 60 * 60 * 24L * day; + long delayTime = System.currentTimeMillis() + (Constant.IS_TEST ? 1000 * 30L : 1000 * 60 * 60 * 24L * day); msg.setStartDeliverTime(delayTime); SendResult sendResult = producer.send(msg); if (sendResult != null) { -- Gitblit v1.8.0