From 5405154d6979f1b50ce2d881bb164b1acca80b6d Mon Sep 17 00:00:00 2001 From: admin <weikou2014> Date: 星期五, 15 一月 2021 18:58:18 +0800 Subject: [PATCH] 修改相关bug --- service-daylucky/src/main/java/com/ks/daylucky/util/mq/consumer/ActivityDrawnNotifyConsumer.java | 19 ++++++++++++------- 1 files changed, 12 insertions(+), 7 deletions(-) diff --git a/service-daylucky/src/main/java/com/ks/daylucky/util/mq/consumer/ActivityDrawnNotifyConsumer.java b/service-daylucky/src/main/java/com/ks/daylucky/util/mq/consumer/ActivityDrawnNotifyConsumer.java index 5c7ff5e..b8614c5 100644 --- a/service-daylucky/src/main/java/com/ks/daylucky/util/mq/consumer/ActivityDrawnNotifyConsumer.java +++ b/service-daylucky/src/main/java/com/ks/daylucky/util/mq/consumer/ActivityDrawnNotifyConsumer.java @@ -1,11 +1,13 @@ package com.ks.daylucky.util.mq.consumer; +import com.ks.daylucky.exception.ActivityDrawnRecieveNotifyInfoException; import com.ks.daylucky.pojo.DO.ActivityDrawnRecieveNotifyInfo; import com.ks.daylucky.service.ActivityDrawnRecieveNotifyInfoService; import com.ks.daylucky.util.mq.CMQManager; import com.ks.lucky.pojo.DO.LuckyActivityAwardResult; import com.ks.lucky.pojo.DO.LuckyActivityAwards; import com.ks.lucky.pojo.DTO.mq.ActivityDrawnMsgDTO; +import com.ks.lucky.pojo.DTO.mq.BaseMQMsg; import com.ks.lucky.remote.service.LuckyActivityAwardResultService; import com.ks.lucky.remote.service.LuckyActivityAwardService; import com.ks.lucky.utils.LuckyCMQConstant; @@ -22,13 +24,12 @@ import java.util.Vector; public class ActivityDrawnNotifyConsumer implements CMQConsumeRunner { - Logger logger = LoggerFactory.getLogger(ActivityDrawnNotifyConsumer.class); - @Reference(version = "1.0.0") + @Reference(version = "1.0.0", check = false) private LuckyActivityAwardResultService luckyActivityAwardResultService; - @Reference(version = "1.0.0") + @Reference(version = "1.0.0", check = false) private LuckyActivityAwardService luckyActivityAwardService; @Resource @@ -39,11 +40,13 @@ new JobThreadExecutorServiceImpl().run(new Runnable() { @Override public void run() { - List<Message> messageList = CMQManager.getInstance().consumeMsgMsg(16); + logger.info("鎺ユ敹娑堟伅"); + List<Message> messageList = CMQManager.getInstance().consumeActivityDrawnMsg(16); if (messageList != null) { for (Message message : messageList) { - Vector<String> vectors = message.msgTag; - if (vectors.contains(LuckyCMQConstant.TAG_ACTIVITY_DRAWN)) { + BaseMQMsg mqMsg = JsonUtil.getSimpleGson().fromJson(message.msgBody, BaseMQMsg.class); + String tag = mqMsg.getCmqMsgTag(); + if (tag.equalsIgnoreCase(LuckyCMQConstant.TAG_ACTIVITY_DRAWN)) { try { //娲诲姩鐘舵�佹敼鍙� @@ -78,7 +81,9 @@ default: break; } - CMQManager.getInstance().deleteMsgMsg(message.receiptHandle); + CMQManager.getInstance().deleteActivityDrawnMsg(message.receiptHandle); + } catch (ActivityDrawnRecieveNotifyInfoException e) { + CMQManager.getInstance().deleteActivityDrawnMsg(message.receiptHandle); } catch (Exception e) { logger.error("閫氱煡娑堣垂鍑洪敊锛�" + e.getMessage()); } -- Gitblit v1.8.0