@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
latch1.countDown();
}
});
templateWithConfirmsEnabled.convertAndSend(ROUTE, (Object) "message", new CorrelationData("abc"));
RabbitTemplate secondTemplate = new RabbitTemplate(connectionFactoryWithConfirmsEnabled);
secondTemplate.setConfirmCallback(new ConfirmCallback() {
@Override
public void confirm(CorrelationData correlationData, boolean ack, String cause) {
latch2.countDown();
}
});
secondTemplate.convertAndSend(ROUTE, (Object) "message", new CorrelationData("def"));
assertTrue(latch1.await(10, TimeUnit.SECONDS));
assertTrue(latch2.await(10, TimeUnit.SECONDS));
assertNull(templateWithConfirmsEnabled.getUnconfirmed(0));
assertNull(secondTemplate.getUnconfirmed(0));
}