Search code examples
javaspringspring-bootrabbitmqspring-rabbit

Spring Boot + RabbitMQ messages lost on delayed exchange


I am using spring boot convertAndSend() to publish a message on a delayed exchange but the message is never being published on the queue and there isn't any exception being thrown


Solution

  • is never being published on the queue and there isn't any exception being thrown

    When a system wants to communicate via a message broker the developer needs a clear understanding of the delivery semantics. At first one needs to know if and how often a message will be delivered to the broker (and potential consumers):

    1. At most once – the message is delivered at most once but also not at all.
    2. At least once – the message guaranteed to be delivered but can be delivered multiple times.
    3. Exactly once – the message is guaranteed to be delivered exactly once.

    The reasons why your messages are lost is because probably you are using at most once semantics.

    You can configure at least once delivery semantics if you follow this guide

    Does this solve your problem ? Tell me in the comments.