Commit 934e62be authored by 杨锐's avatar 杨锐

confirm first message status.

parent a599264b
......@@ -62,8 +62,11 @@ public class MORabbitMQConfiguration {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> {
if (ack) {
KoalaRabbitmqMessage koalaRabbitmqMessage = koalaRabbitmqMessageMapperV1.selectByUniqueId(correlationData.getId());
if (koalaRabbitmqMessage.getConsumeCount() == 0) {
koalaRabbitmqMessageMapperV1.updateMsgStatusByUniqueId(correlationData.getId(), Constants.MSG_STATUS_SUCCESS);
}
}
});
rabbitTemplate.setBeforePublishPostProcessors(new CorrelationAwareMessagePostProcessor() {
@Override
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment