Beispiel #1
0
 protected ConsumeConcurrentlyStatus exceptionConsumeConcurrentlyStatus(
     TransactionStatus status, Throwable e, MsgObj msgObj, int maxRetryCount) {
   logger.error("mq consume failed", e);
   status.setRollbackOnly();
   if (msgObj.getReconsumeTimes() >= maxRetryCount) {
     logger.error(
         "retryCount: {}, msgs: {}, context: {}", maxRetryCount, msgObj, msgObj.getContext());
     msgObj.setErrorMsg(e.getMessage());
     doLogErrorConsumeMessage(msgObj);
     return ConsumeConcurrentlyStatus.CONSUME_SUCCESS;
   } else {
     return ConsumeConcurrentlyStatus.RECONSUME_LATER;
   }
 }