paascloud/paascloud-master · error · TpcBizException
TPC10050006
TPC10050006
Error message
TPC10050006
What it means
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.
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).
Example fix
// before
tpcMqMessageService.resendMessageByMessageId(id); // throws if id missing
// after
TpcMessageVo vo = tpcMqMessageService.listReliableMessageVo(Collections.singletonList(id));
if (!vo.isEmpty()) {
tpcMqMessageService.resendMessageByMessageId(id);
} Defensive patterns
Strategy: validation
Validate before calling
TpcMqMessage msg = null; // verify existence via list/query before resend // e.g. query the message table by id and only resend when a row exists
Try / catch
try {
tpcMqMessageService.resendMessageByMessageId(messageId);
} catch (TpcBizException e) {
if ("TPC10050006".equals(e.getMessage())) { /* mark job stale, resync ids */ }
throw e;
} Prevention
- Refresh message ids from a live query before resend operations
- Avoid long-lived cached ids across cleanup cycles
- Verify environment/database consistency
When it happens
Trigger: Calling resendMessageByMessageId with an id that doesn't exist in tpc_mq_message, was deleted, or belongs to another database/environment.
Common situations: Stale id cached on the client after a purge job; id from a different environment; hard delete removed the row before resend was attempted.
Understand the failure class
Background: Record Not Found Errors: "not found", RecordNotFound, and "was not found" — what they mean and how to fix them — this error's family across 28 libraries.
Related errors
AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10).
Data as JSON: /api/errors/556a79621fa2c8f7.
Report an issue: GitHub.
Appendix: source
Thrown at paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/service/impl/TpcMqMessageServiceImpl.java:130
message.setUpdateTime(now);
message.setCreatedTime(now);
tpcMqMessageMapper.insertSelective(message);
// 创建消费待确认列表
this.createMqConfirmListByTopic(message.getMessageTopic(), message.getId(), message.getMessageKey());
this.directSendMessage(tpcMqMessageDto.getMessageBody(), tpcMqMessageDto.getMessageTopic(), tpcMqMessageDto.getMessageTag(), tpcMqMessageDto.getMessageKey(), tpcMqMessageDto.getProducerGroup(), tpcMqMessageDto.getDelayLevel());
}
@Override
public void directSendMessage(String body, String topic, String tag, String key, String pid, Integer delayLevel) {
RocketMqProducer.sendSimpleMessage(body, topic, tag, key, pid, delayLevel);
}
@Override
public void resendMessageByMessageId(Long messageId) {
final TpcMqMessage message = tpcMqMessageMapper.selectByPrimaryKey(messageId);
if (message == null) {
throw new TpcBizException(ErrorCodeEnum.TPC10050006);
}
this.resendMessage(message);
}
@Override
public void resendMessageByMessageKey(String messageKey) {
final TpcMqMessage task = tpcMqMessageMapper.getByMessageKey(messageKey);
this.resendMessage(task);
}
@Override
public void setMessageToAlreadyDead(Long messageId) {
final TpcMqMessage task = tpcMqMessageMapper.selectByPrimaryKey(messageId);
if (task == null) {
throw new TpcBizException(ErrorCodeEnum.TPC10050006);
}
tpcMqMessageMapper.updateAlreadyDeadByMessageId(messageId);View on GitHub (pinned to 781281a950)