public void onMessageReceive(Record record) { if (!started.getAndSet(true)) { long begin = System.currentTimeMillis(); log.info(sortingLog.sortingStart(LogCode.SORTING_START, begin)); } sortingMsgReceiveCountStatistic.addStatistic(); if (cacheInterface == null || sender == null) { // 异常处理 throw new IllegalArgumentException("catch interface or sender are required "); } String srcPhone = record.getSrcPhone(); if (null == srcPhone || "".equals(srcPhone)) { // 异常处理 log.error(sortingLog.sortingSrcPhoneError(LogCode.SORTING_SRCPHONE_ERROR, record)); return; } sortingCacheCountStatistic.addStatistic(); String userId = cacheInterface.getUser(srcPhone); if (null == userId || "".equals(userId)) { // 异常处理 log.error( sortingLog.sortingUserIDNotFoundLog( LogCode.SORTING_USER_ID_NOT_FOUND, record.getSrcPhone())); return; } record.setUserId(userId); sender.sendRecord(record, callback); }