Search in sources :

Example 1 with TpcMqConfirm

use of com.paascloud.provider.model.domain.TpcMqConfirm in project paascloud-master by paascloud.

the class TpcMqMessageServiceImpl method createMqConfirmListByTopic.

@Override
public void createMqConfirmListByTopic(final String topic, final Long messageId, final String messageKey) {
    List<TpcMqConfirm> list = Lists.newArrayList();
    TpcMqConfirm tpcMqConfirm;
    List<String> consumerGroupList = tpcMqConsumerService.listConsumerGroupByTopic(topic);
    if (PublicUtil.isEmpty(consumerGroupList)) {
        throw new TpcBizException(ErrorCodeEnum.TPC100500010, topic);
    }
    for (final String cid : consumerGroupList) {
        tpcMqConfirm = new TpcMqConfirm(UniqueIdGenerator.generateId(), messageId, messageKey, cid);
        list.add(tpcMqConfirm);
    }
    tpcMqConfirmMapper.batchCreateMqConfirm(list);
}
Also used : TpcMqConfirm(com.paascloud.provider.model.domain.TpcMqConfirm) TpcBizException(com.paascloud.provider.exceptions.TpcBizException)

Aggregations

TpcBizException (com.paascloud.provider.exceptions.TpcBizException)1 TpcMqConfirm (com.paascloud.provider.model.domain.TpcMqConfirm)1