Receiving the same message for two times (double message)

4,255 views
Skip to first unread message

g kuczera

unread,
Apr 15, 2016, 7:59:45 AM4/15/16
to rabbitmq-users
Hi guys,
I am trying to seek the bug connected with rabbitmq - our user got the same message two times (on 25th February and 29th March).

Firstly, I would describe the system briefly:
- there is an webapp (Tapestry based) - user can use it to apply for access to specific data; applying = sending a message to RabbitMQ
- RabbitMQ is queueing the messages and sending them to the consumer
- the consumer sends emails to the administrators, who will be considering the applications
- after sending the email, the entry in mongo database is created (the content of the message is inserted there)

So how sending two identical messages is possible? There is only one entry in mongo database about user's activity, so it looks that he was applying only for one time.
I read that the acknowledgement must be sent to the Rabbit, but I also have read that in spring-rabbit the acknowledgement is automatic. Do you have any idea?

Consumer is written in java with spring-rabbit library.
https://github.com/spring-projects/spring-amqp/tree/master/spring-rabbit

I am not pretty much a java/spring/rabbitmq guy, but I try as I can to learn these technologies (for few days by now).

Michael Denny

unread,
Apr 15, 2016, 8:50:30 AM4/15/16
to rabbitmq-users
This could clarify your doubts regarding message duplication:

  • Use of acknowledgements guarantees at-least-once delivery: so it means it could send the message more than one time.
  • Without acknowledgements, message loss is possible during publish and consume operations and only at-most-once delivery is guaranteed: in this way only one message will be sent (at most) but then you can lost messages.
  • In the event of network failure (or a node crashing), messages can be duplicated, and consumers must be prepared to handle them. If possible, the simplest way to handle this is to ensure that your consumers handle messages in an idempotent way rather than explicitly deal with deduplication. (even using acknowledgements)
Reply all
Reply to author
Forward
0 new messages