paascloud/paascloud-master · error · TpcBizException

TPC10050003

TPC10050003

Error message

TPC10050003

What it means

Fires in TpcMqMessageServiceImpl.deleteMessageByMessageKey when tpcMqMessageMapper.deleteMessageByMessageKey returns fewer than 1 affected rows, i.e. no message with the supplied messageKey existed to delete. Maps to ErrorCodeEnum.TPC10050003 with the offending messageKey passed as an exception argument; the caller should verify the messageKey.

Solutions

  1. Verify the messageKey exists before deleting, or tolerate idempotent deletes.
  2. Remove the second delete call in retry/idempotent flows.
  3. Check for row-removal races with scheduled cleanup jobs.
Defensive patterns

Strategy: try-catch

Validate before calling

// existence check: only delete keys known to exist
boolean exists = tpcMqMessageService.listReliableMessageVo(Collections.singletonList(id)).size() > 0;

Try / catch

try {
    tpcMqMessageService.deleteMessageByMessageKey(messageKey);
} catch (TpcBizException e) {
    if ("TPC10050003".equals(e.getMessage())) { /* treat as idempotent success */ return; }
    throw e;
}

Prevention

When it happens

Trigger: Calling deleteMessageByMessageKey with a key that doesn't exist, or deleting an already-deleted message (second call).

Common situations: Double delete from a retrying consumer; typo'd or truncated messageKey; cleanup job already removed the row.

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/29804ab7dca990d6. Report an issue: GitHub.

Appendix: source

Thrown at paascloud-provider/paascloud-provider-tpc/src/main/java/com/paascloud/provider/service/impl/TpcMqMessageServiceImpl.java:156

		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);
	}

	@Override
	public void deleteMessageByMessageKey(String messageKey) {

		int result = tpcMqMessageMapper.deleteMessageByMessageKey(messageKey);
		if (result < 1) {
			throw new TpcBizException(ErrorCodeEnum.TPC10050003, messageKey);
		}
	}

	@Override
	public void resendAllDeadMessageByTopicName(String topicName, int batchSize) {
		// 1.查询该topic下所有死亡的消息
		// 2.分页
	}

	@Override
	public List<TpcMqMessage> listMessageForWaitingProcess(MessageTaskQueryDto query) {
		return tpcMqMessageMapper.listMessageForWaitingProcess(query);
	}

	@Override
	public void confirmReceiveMessage(final String cid, final String messageKey) {
		// 1. 校验cid
		// 2. 校验messageKey

View on GitHub (pinned to 781281a950)