allthingssecurity commented on PR #30921:
URL: https://github.com/apache/camel/pull/30921#issuecomment-7214381164

   Thanks Claus, and thanks for checking the Paho sources.
   
   - **Receiving client:** done in c1d15bbf. The callback passes the client the 
message arrived on, so the exchange acks or rolls back on that client; the 
public `createExchange(MqttMessage, String)` still uses the current client. The 
new test `messageTakenBeforeTheClientIsReplacedKeepsTheClientItArrivedOn` hands 
a message from the first client's callback to the consumer, replaces the client 
before the exchange is created, and checks that neither client acks it (before 
the change it was acked on the new client).
   - **tearDown:** now stops the consumer before the context, so no static 
callback entry is left behind.
   - **Backport:** 4.22.x has the CAMEL-25793 reconnect (c558c2b4cf4a) but not 
CAMEL-25851 (the shared `PahoMqtt5ClientCallback`), CAMEL-25944, CAMEL-27040 or 
CAMEL-27041, and this fix relies on the CAMEL-27040 guard that acks only on the 
receiving, still current client. So it would be its own port to 4.22.x, 
bringing that guard along, with an upgrade note in the 4.22 guide for the new 
client instance and the in-route exchanges that are not acknowledged. I can 
open that once this one is merged.
   - **Paho issue:** I searched eclipse-paho/paho.mqtt.java and found no issue 
for `CommsCallback.start()` spinning after `stop()` while a thread is still in 
`messageArrived` (the closest are #999 and #964, which are different). I will 
open a follow-up JIRA for the automatic reconnect case and link it from the 
component page.
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to