{"record":{"id":"556a79621fa2c8f7","repo":"paascloud/paascloud-master","slug":"tpc10050006","errorCode":"TPC10050006","errorMessage":"TPC10050006","messagePattern":"TPC10050006","errorType":"error_code","errorClass":"TpcBizException","httpStatus":null,"severity":"error","filePath":"paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/service/impl/TpcMqMessageServiceImpl.java","lineNumber":130,"sourceCode":"\t\tmessage.setUpdateTime(now);\n\t\tmessage.setCreatedTime(now);\n\n\t\ttpcMqMessageMapper.insertSelective(message);\n\t\t// 创建消费待确认列表\n\t\tthis.createMqConfirmListByTopic(message.getMessageTopic(), message.getId(), message.getMessageKey());\n\t\tthis.directSendMessage(tpcMqMessageDto.getMessageBody(), tpcMqMessageDto.getMessageTopic(), tpcMqMessageDto.getMessageTag(), tpcMqMessageDto.getMessageKey(), tpcMqMessageDto.getProducerGroup(), tpcMqMessageDto.getDelayLevel());\n\t}\n\n\t@Override\n\tpublic void directSendMessage(String body, String topic, String tag, String key, String pid, Integer delayLevel) {\n\t\tRocketMqProducer.sendSimpleMessage(body, topic, tag, key, pid, delayLevel);\n\t}\n\n\t@Override\n\tpublic void resendMessageByMessageId(Long messageId) {\n\t\tfinal TpcMqMessage message = tpcMqMessageMapper.selectByPrimaryKey(messageId);\n\t\tif (message == null) {\n\t\t\tthrow new TpcBizException(ErrorCodeEnum.TPC10050006);\n\t\t}\n\t\tthis.resendMessage(message);\n\t}\n\n\t@Override\n\tpublic void resendMessageByMessageKey(String messageKey) {\n\t\tfinal TpcMqMessage task = tpcMqMessageMapper.getByMessageKey(messageKey);\n\t\tthis.resendMessage(task);\n\t}\n\n\t@Override\n\tpublic void setMessageToAlreadyDead(Long messageId) {\n\t\tfinal TpcMqMessage task = tpcMqMessageMapper.selectByPrimaryKey(messageId);\n\t\tif (task == null) {\n\t\t\tthrow new TpcBizException(ErrorCodeEnum.TPC10050006);\n\t\t}\n\n\t\ttpcMqMessageMapper.updateAlreadyDeadByMessageId(messageId);","sourceCodeStart":112,"sourceCodeEnd":148,"githubUrl":"https://github.com/paascloud/paascloud-master/blob/781281a9503332ed3cef44ea618349d14230a127/paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/service/impl/TpcMqMessageServiceImpl.java#L112-L148","documentation":"Fires in TpcMqMessageServiceImpl.resendMessageByMessageId when tpcMqMessageMapper.selectByPrimaryKey(messageId) finds no message row for the given ID, meaning the caller requested a resend of a nonexistent or already-deleted TPC MQ message. Maps to ErrorCodeEnum.TPC10050006; the caller must pass a valid existing message ID.","triggerScenarios":"Calling resendMessageByMessageId with an id that doesn't exist in tpc_mq_message, was deleted, or belongs to another database/environment.","commonSituations":"Stale id cached on the client after a purge job; id from a different environment; hard delete removed the row before resend was attempted.","solutions":["Verify the messageId exists in the tpc_mq_message table.","Ensure the resend call targets the same environment/database the message was stored in.","Handle the not-found case in the caller (query list first, resend only existing ids)."],"exampleFix":"// before\ntpcMqMessageService.resendMessageByMessageId(id); // throws if id missing\n// after\nTpcMessageVo vo = tpcMqMessageService.listReliableMessageVo(Collections.singletonList(id));\nif (!vo.isEmpty()) {\n    tpcMqMessageService.resendMessageByMessageId(id);\n}","handlingStrategy":"validation","validationCode":"TpcMqMessage msg = null; // verify existence via list/query before resend\n// e.g. query the message table by id and only resend when a row exists","typeGuard":null,"tryCatchPattern":"try {\n    tpcMqMessageService.resendMessageByMessageId(messageId);\n} catch (TpcBizException e) {\n    if (\"TPC10050006\".equals(e.getMessage())) { /* mark job stale, resync ids */ }\n    throw e;\n}","preventionTips":["Refresh message ids from a live query before resend operations","Avoid long-lived cached ids across cleanup cycles","Verify environment/database consistency"],"tags":["mq","message-id","not-found"],"backgroundTag":"record-not-found","analyzedSha":"781281a9503332ed3cef44ea618349d14230a127","analyzedAt":"2026-09-10T10:59:02.070Z","contentChangedAt":"2026-09-10T10:59:02.070Z","schemaVersion":2},"datasetVersion":"2026-09-16T04:17:20.429Z"}