Claus Ibsen created CAMEL-27830:
-----------------------------------
Summary: camel-paho: the producer drops a client set by the client
option on restart, a user name without a password is dropped
Key: CAMEL-27830
URL: https://issues.apache.org/jira/browse/CAMEL-27830
Project: Camel
Issue Type: Bug
Components: camel-paho
Reporter: Claus Ibsen
Fix For: 4.25.0
Found while improving the option descriptions of camel-paho for CAMEL-23832
(pull request https://github.com/apache/camel/pull/31141).
These are separate problems of the component; the descriptions change only
documents the current behavior.
h4. 1. The producer drops the shared client on restart
{{PahoProducer.doStop}} sets client = null every time, also for a client set by
the client option. After a stop and start (a route restart) the producer
creates its own client from brokerUrl and connects it. It also only disconnects
its own client and never calls close(true), while the consumer does both.
Proposed change: keep an external client, as PahoConsumer.doStop does.
h4. 2. A user name without a password is dropped
{{PahoEndpoint.createMqttConnectOptions}} sets the user name and password only
when both are set; a user name alone is dropped without a message, though MQTT
3.1.1 allows it.
Proposed change: set the user name on its own, and the password when it is set.
h4. 3. Double acknowledgement with manualAcksEnabled and an external client
{{PahoClientCallback.register}} does not call setManualAcks(true) on a client
from the client option; Paho acknowledges when the callback returns, and Camel
acknowledges again on completion (a second PUBACK or PUBCOMP).
Proposed change: set manual acks on the client, or warn.
_Claude Code on behalf of davsclaus_
--
This message was sent by Atlassian Jira
(v10.3.26#10030026)