优化处理,避免重复异常消息入库

This commit is contained in:
2023-08-18 15:19:14 +08:00
parent e4a9e4edf5
commit abd07dc172

View File

@@ -105,8 +105,11 @@ public class AppAutoDataConsumer extends EnhanceConsumerMessageHandler<AppAutoDa
exceptionMsg = exceptionMsg.substring(0,180);
}
rocketmqMsgErrorLog.setRecord(exceptionMsg);
//如果是当前消息重试的则略过
if(!message.getSource().startsWith(EnhanceMessageConstant.RETRY_PREFIX)){
//单次消费异常
rocketMqLogFeignClient.add(rocketmqMsgErrorLog);
}
} else {
rocketmqMsgErrorLog.setRecord("重试消费" + super.getMaxRetryTimes() + "次,依旧消费失败。");
//重试N次后依然消费异常