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

confirm first message status.

parent a599264b
...@@ -62,7 +62,10 @@ public class MORabbitMQConfiguration { ...@@ -62,7 +62,10 @@ public class MORabbitMQConfiguration {
RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory); RabbitTemplate rabbitTemplate = new RabbitTemplate(connectionFactory);
rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> { rabbitTemplate.setConfirmCallback((correlationData, ack, cause) -> {
if (ack) { if (ack) {
koalaRabbitmqMessageMapperV1.updateMsgStatusByUniqueId(correlationData.getId(), Constants.MSG_STATUS_SUCCESS); KoalaRabbitmqMessage koalaRabbitmqMessage = koalaRabbitmqMessageMapperV1.selectByUniqueId(correlationData.getId());
if (koalaRabbitmqMessage.getConsumeCount() == 0) {
koalaRabbitmqMessageMapperV1.updateMsgStatusByUniqueId(correlationData.getId(), Constants.MSG_STATUS_SUCCESS);
}
} }
}); });
rabbitTemplate.setBeforePublishPostProcessors(new CorrelationAwareMessagePostProcessor() { rabbitTemplate.setBeforePublishPostProcessors(new CorrelationAwareMessagePostProcessor() {
......
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