Source:
<code>public void consume(String message) { logger.info("[标的放款MQ] LoanOutSuccess_SmsMessage receive message: {}: {}.", this.queue(), message); if (!StringUtils.isEmpty(message)) { LoanOutSuccessMessage loanOutInfo; try { loanOutInfo = JsonConverter.readValue(message, LoanOutSuccessMessage.class); } catch (IOException e) { logger.error("[标的放款MQ] LoanOutSuccess_RewardReferrer json convert LoanOutSuccessMessage is fail, message:{}", message); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto("发放推荐人奖励失败")); throw new RuntimeException(e); } long loanId = loanOutInfo.getLoanId(); List<String> fatalSmsList = Lists.newArrayList(); logger.info("[标的放款MQ] LoanOutSuccess_RewardReferrer is execute，loanId:" + loanId); <START> if (!payWrapperClient.sendRewardReferrer(loanId).isSuccess()) { <END> fatalSmsList.add("发放推荐人奖励失败"); logger.error(MessageFormat.format("[标的放款MQ] LoanOutSuccess_RewardReferrer is fail (loanId = {0})", String.valueOf(loanId))); } if (CollectionUtils.isNotEmpty(fatalSmsList)) { fatalSmsList.add(MessageFormat.format("标的ID:{0}", loanId)); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto(Joiner.on(",").join(fatalSmsList))); logger.error(MessageFormat.format("[标的放款MQ] LoanOutSuccess_RewardReferrer is fail, sms sending. loanId:{0}, queue:{1}", String.valueOf(loanId), MessageQueue.LoanOutSuccess_RewardReferrer)); throw new RuntimeException("[标的放款MQ] LoanOutSuccess_RewardReferrer is fail. loanOutInfo: " + message); } logger.info("[标的放款MQ] LoanOutSuccess_RewardReferrer consume success."); } }</code><technical_language>try catch</technical_language>

Target:
public void consume(String message) { logger.info("[标的放款MQ] LoanOutSuccess_RewardReferrer receive message: {}: {}.", this.queue(), message); if (Strings.isNullOrEmpty(message)) { logger.error("[标的放款MQ] LoanOutSuccess_RewardReferrer receive message is empty"); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto("放款发放推荐人奖励失败, MQ消息为空")); return; } LoanOutSuccessMessage loanOutInfo; try { loanOutInfo = JsonConverter.readValue(message, LoanOutSuccessMessage.class); if (loanOutInfo.getLoanId() == null) { logger.error("[标的放款MQ] LoanOutSuccess_RewardReferrer loanId is empty"); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto("放款发放推荐人奖励失败, 消息中loanId为空")); return; } } catch (IOException e) { logger.error("[标的放款MQ] LoanOutSuccess_RewardReferrer json convert LoanOutSuccessMessage is fail, message:{}", message); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto("放款发放推荐人奖励失败, 解析消息失败")); return; } long loanId = loanOutInfo.getLoanId(); logger.info("[标的放款MQ] LoanOutSuccess_RewardReferrer is executing，loanId:" + loanId); boolean result; try { result = payWrapperClient.sendRewardReferrer(loanId).isSuccess(); } catch (Exception e) { logger.error(MessageFormat.format("[标的放款MQ] LoanOutSuccess_RewardReferrer sendRewardReferrer is fail,loanId({0}), error:{0}", String.valueOf(loanId), e)); smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto("放款发放推荐人奖励失败, 业务处理异常")); return; } if (!result) { smsWrapperClient.sendFatalNotify(new SmsFatalNotifyDto(MessageFormat.format("发放推荐人奖励失败,标的ID:{0}", String.valueOf(loanId)))); logger.error(MessageFormat.format("[标的放款MQ] LoanOutSuccess_RewardReferrer is fail (loanId = {0})", String.valueOf(loanId))); throw new RuntimeException("[标的放款MQ] LoanOutSuccess_RewardReferrer is fail. loanOutInfo: " + message); } logger.info("[标的放款MQ] LoanOutSuccess_RewardReferrer consume success."); }