paascloud/paascloud-master · error · TpcBizException

TPC10050001

TPC10050001

Error message

TPC10050001

What it means

TPC10050001 signals that a TPC MQ message cannot be persisted because its messageTopic is empty. saveMessageWaitingConfirm validates topic presence before mapping the DTO and creating a WAIT_SEND message record.

Solutions

  1. Set messageTopic on the TpcMqMessageDto before calling saveMessageWaitingConfirm.
  2. Validate the topic at the producer's construction point to fail fast.
  3. Check that the field name/copy mechanism (mapper, beanutils) actually populates messageTopic.

Example fix

// before
TpcMqMessageDto dto = new TpcMqMessageDto();
dto.setMessageBody(body);
tpcMqMessageService.saveMessageWaitingConfirm(dto);
// after
TpcMqMessageDto dto = new TpcMqMessageDto();
dto.setMessageTopic("user-topic");
dto.setMessageBody(body);
tpcMqMessageService.saveMessageWaitingConfirm(dto);
Defensive patterns

Strategy: validation

Validate before calling

if (dto == null || StringUtils.isEmpty(dto.getMessageTopic())) {
    throw new IllegalArgumentException("messageTopic is required");
}

Try / catch

try {
    tpcMqMessageService.saveMessageWaitingConfirm(dto);
} catch (TpcBizException e) {
    if ("TPC10050001".equals(e.getMessage())) { /* surface 'topic required' to caller */ }
    throw e;
}

Prevention

When it happens

Trigger: Calling TpcMqMessageServiceImpl.saveMessageWaitingConfirm with a TpcMqMessageDto whose messageTopic is null or an empty string.

Common situations: Producer code forgets to set the topic before building the DTO; topic field lost when copying from a config object or map; refactored DTO construction dropped setmessageTopic.

Understand the failure class

Background: "must not be empty", "cannot be empty" — required-field validation errors across open-source libraries — this error's family across 41 libraries.

Related errors


AI-assisted analysis of paascloud/paascloud-master@781281a950 (2026-09-10). Data as JSON: /api/errors/b57e0310fb888408. Report an issue: GitHub.

Appendix: source

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

public class TpcMqMessageServiceImpl extends BaseService<TpcMqMessage> implements TpcMqMessageService {
	@Resource
	private TpcMqMessageMapper tpcMqMessageMapper;
	@Resource
	private TpcMqConfirmMapper tpcMqConfirmMapper;
	@Resource
	private TpcMqConsumerService tpcMqConsumerService;
	@Resource
	private UacRpcService uacRpcService;
	@Resource
	private MdcRpcService mdcRpcService;
	@Resource
	private OpcRpcService opcRpcService;

	@Override
	public void saveMessageWaitingConfirm(TpcMqMessageDto messageDto) {

		if (StringUtils.isEmpty(messageDto.getMessageTopic())) {
			throw new TpcBizException(ErrorCodeEnum.TPC10050001);
		}

		Date now = new Date();
		TpcMqMessage message = new ModelMapper().map(messageDto, TpcMqMessage.class);
		message.setMessageStatus(MqSendStatusEnum.WAIT_SEND.sendStatus());
		message.setUpdateTime(now);
		message.setCreatedTime(now);
		tpcMqMessageMapper.insertSelective(message);
	}

	@Override
	public void confirmAndSendMessage(String messageKey) {
		final TpcMqMessage message = tpcMqMessageMapper.getByMessageKey(messageKey);
		if (message == null) {
			throw new TpcBizException(ErrorCodeEnum.TPC10050002);
		}

		TpcMqMessage update = new TpcMqMessage();

View on GitHub (pinned to 781281a950)