RabbitMq Mqtt : avoid redelivery or detect duplicate messages

763 views
Skip to first unread message

Kaveri P.H

unread,
Jan 19, 2017, 7:59:24 AM1/19/17
to rabbitmq-users

Hello All,

 

We are using RabbitMq Mqtt Broker with Paho Client for achieving an use case where sender and receiver interact.

 

We want to ensure that messages are NOT re-delivered to the receiver upon reconnection.

How do we ensure the same ? We are fine if we avoid redelivery of messages from Broker to Receiver or atleast detect duplicate arrivals at Receiver .

 

We are using configurations a) Clean Session as false b)  with QOS = 1 c) retain flag to true. We use the same client Id for reconnection.

Still , we receive the messages again ( without dup flag = true). Same behavior even if QOS = 0.

 

Please guide how to avoid redelivery or detection of duplicates mqtt messages.  Does QOS = 2 work with RabbitMq  Mqtt?


Kindly help.


Thanks & Regards,

Kaveri

Arnaud Cogoluègnes

unread,
Jan 19, 2017, 8:13:57 AM1/19/17
to rabbitm...@googlegroups.com
RabbitMQ MQTT plugin doesn't support MQTT's QoS = 2.

With the configuration you're using (clean session = false and retain = true), the behavior is consistent with the specification. To avoid duplicates, you can set the retain flag to false (not ideal, disconnected consumers could miss messages). The best option is to make your consumers idempotent (duplicate-tolerant).

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Michael Klishin

unread,
Jan 19, 2017, 9:02:09 AM1/19/17
to rabbitm...@googlegroups.com
QoS = 2 promises something that can only be delivered on when all cluster nodes and peers are coordinated.
This would introduce very substantial performance overhead and availability limitations.

Exactly once delivery is a myth: redeliveries are a fact of life in distributed systems. Exactly once *processing*
is certainly very much possible if you make your consumers idempotent.

Don't fall into the QoS 2 promise trap.

To post to this group, send email to rabbitm...@googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "rabbitmq-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rabbitmq-users+unsubscribe@googlegroups.com.
To post to this group, send email to rabbitmq-users@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
MK

Staff Software Engineer, Pivotal/RabbitMQ
Reply all
Reply to author
Forward
0 new messages