Search code examples
javaspringrabbitmqamqpspring-amqp

Does RabbitTemplate.send() guarantee the delivery of messages to RabbitMQ?


Using Spring AMQP, when the call to the method rabbitTemplate.send(message) returns (from org.springframework.amqp.rabbit.core.RabbitTemplate class), can we be sure that the message has been delivered and replicated on the RabbitMQ cluster?


Solution

  • No it does not. AMQP is an asynchronous protocol. To guarantee delivery you need to use Publisher Confirms and Returns - and even then, the confirmation (or return) comes back on another thread.