[ 
https://issues.apache.org/jira/browse/CAMEL-9092?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Raúl Kripalani closed CAMEL-9092.
---------------------------------
       Resolution: Fixed
    Fix Version/s: 2.15.4
                   2.16.0

The {{connected = true}} is OK in {{onConnected()}}.
Where it needed to be removed was from {{onDisconnected()}} because the MQTT 
client handles its own reconnection. Setting {{connected = false}} was tricking 
the endpoint into creating yet another connection while the original one was 
trying to reconnect. I think this led to more than 1 consumer showing up on the 
topic and hence the appearance of duplicates.

Thanks for the report and the patch, [~igarashitm]. I merged it with the 
aforementioned change as well as making the {{uri}} param final in the 
constructor of MQTTEndpoint.

> MQTT consumer receives duplicate messages after broker restart
> --------------------------------------------------------------
>
>                 Key: CAMEL-9092
>                 URL: https://issues.apache.org/jira/browse/CAMEL-9092
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-mqtt
>    Affects Versions: 2.15.2, 2.16.0
>            Reporter: Tomohisa Igarashi
>            Assignee: Raúl Kripalani
>             Fix For: 2.16.0, 2.15.4
>
>         Attachments: MQTTDuplicatesTest.java, MQTTDuplicatesTest.java_activemq
>
>
> if clientId is specified, after ActiveMQ broker restart, camel-mqtt consumer 
> starts to receive duplicate messages. Please see the testcase attached.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to