|
|
@ -48,24 +48,22 @@ public class GroupAchievementCustomListener implements MessageListenerConcurrent |
|
|
|
RLock lock = null; |
|
|
|
try { |
|
|
|
distributedLock = SpringContextUtils.getBean(DistributedLock.class); |
|
|
|
lock = distributedLock.getLock(String.format("lock:init_customer_org:%s", msgObj.getCustomerId()), |
|
|
|
30l, 30l, TimeUnit.SECONDS); |
|
|
|
|
|
|
|
|
|
|
|
lock = distributedLock.getLock(String.format("lock:group_achievement:%s", msgObj.getCustomerId()) |
|
|
|
,30L, 30L, TimeUnit.SECONDS); |
|
|
|
|
|
|
|
if (StringUtils.isBlank(msgObj.getAchievementType()) || StringUtils.isBlank(msgObj.getCustomerId()) |
|
|
|
|| StringUtils.isBlank(msgObj.getGroupId())){ |
|
|
|
logger.error("consumer fail,msg:{}",msgObj); |
|
|
|
logger.error("consumer groupAchievement fail,msg:{}",msgObj); |
|
|
|
return; |
|
|
|
} |
|
|
|
//消息被消费太快 业务数据还没有完成 歇一会先
|
|
|
|
try { |
|
|
|
Thread.sleep(200L); |
|
|
|
Thread.sleep(60L); |
|
|
|
} catch (InterruptedException e) { |
|
|
|
logger.error("consumeMessage sleep",e); |
|
|
|
logger.error("consumeMessage sleep exception",e); |
|
|
|
} |
|
|
|
Boolean aBoolean = SpringContextUtils.getBean(StatsAchievementService.class).calculateAcm(msgObj.getCustomerId(), msgObj.getGroupId(), msgObj.getAchievementType()); |
|
|
|
logger.info("consumer msg success,{}",aBoolean); |
|
|
|
logger.info("consumer groupAchievement msg success,{}",aBoolean); |
|
|
|
} catch (RenException e) { |
|
|
|
// 如果是我们手动抛出的异常,说明在业务可控范围内。目前不需要MQ重试
|
|
|
|
logger.error("【RocketMQ】消费小组成就消息失败:",e); |
|
|
|