This is an automated email from the ASF dual-hosted git repository. apupier pushed a commit to branch main in repository https://gitbox.apache.org/repos/asf/camel.git
commit ca7c6e1f07603e85f5bb86cb06859c31f1880a7c Author: Thomas Strauss <[email protected]> AuthorDate: Thu Oct 1 09:11:04 2026 +0200 CAMEL-25030: camel-hivemq: document cleanStart semantics differ by version Addresses review feedback (@davsclaus, https://github.com/apache/camel/pull/27104#discussion_r4146727126): cleanStart=false behaves differently between the two protocol versions and that wasn't documented anywhere. With MQTT 3.1.1, the broker keeps the session (subscriptions and queued QoS 1/2 messages) indefinitely; with MQTT 5 the session still expires on disconnect, since this component does not set a session expiry interval. Adds one sentence to the cleanStart field's javadoc (which is also the @UriParam description surfaced in the catalog/DSL docs) and to the "MQTT protocol version" section of hivemq-component.adoc. Regenerated the component's own metadata, the catalog/camel-catalog mirror, and the component/endpoint DSL builder factories via a full, non-quickly `mvn install -DskipTests` build (BUILD SUCCESS) so the new text is reflected everywhere it is surfaced, per the review request. Verified: all unit tests still pass (javadoc/doc-only change). AI-assisted contribution: authored together with Claude Sonnet 5 (Anthropic). Co-Authored-By: Claude Sonnet 5 <[email protected]> --- .../apache/camel/catalog/components/hivemq.json | 4 +-- .../camel/catalog/docs/hivemq-component.adoc | 5 +++ .../org/apache/camel/component/hivemq/hivemq.json | 4 +-- .../src/main/docs/hivemq-component.adoc | 5 +++ .../component/hivemq/HiveMQConfiguration.java | 4 ++- .../dsl/HivemqComponentBuilderFactory.java | 7 +++- .../endpoint/dsl/HiveMQEndpointBuilderFactory.java | 42 ++++++++++++++++++---- 7 files changed, 59 insertions(+), 12 deletions(-) diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hivemq.json b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hivemq.json index 0dbbee22aad2..8d0a688a583d 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hivemq.json +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/components/hivemq.json @@ -24,7 +24,7 @@ "remote": true }, "componentProperties": { - "cleanStart": { "index": 0, "kind": "property", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 a [...] + "cleanStart": { "index": 0, "kind": "property", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 a [...] "clientId": { "index": 1, "kind": "property", "displayName": "Client Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Client identifier used when connecting to the HiveMQ broker." }, "configuration": { "index": 2, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hivemq.HiveMQConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration." }, "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "localhost", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Hostname or IP address of the HiveMQ MQTT broker." }, @@ -47,7 +47,7 @@ }, "properties": { "topic": { "index": 0, "kind": "path", "displayName": "Topic", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The MQTT topic name or pattern to subscribe to or publish on." }, - "cleanStart": { "index": 1, "kind": "parameter", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 [...] + "cleanStart": { "index": 1, "kind": "parameter", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 [...] "clientId": { "index": 2, "kind": "parameter", "displayName": "Client Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Client identifier used when connecting to the HiveMQ broker." }, "host": { "index": 3, "kind": "parameter", "displayName": "Host", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "localhost", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Hostname or IP address of the HiveMQ MQTT broker." }, "mqttVersion": { "index": 4, "kind": "parameter", "displayName": "Mqtt Version", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "com.hivemq.client.mqtt.MqttVersion", "enum": [ "MQTT_3_1_1", "MQTT_5_0" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MQTT_5_0", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "The MQTT protocol version to use [...] diff --git a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/hivemq-component.adoc b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/hivemq-component.adoc index 0121e4ce2adb..6438de7e6a8f 100644 --- a/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/hivemq-component.adoc +++ b/catalog/camel-catalog/src/generated/resources/org/apache/camel/catalog/docs/hivemq-component.adoc @@ -237,6 +237,11 @@ from("hivemq:some/topic" .to("mock:test"); ---- +The `cleanStart` option behaves differently between the two protocol versions when set to +`false`. With MQTT 3.1.1, the broker keeps the session (subscriptions and queued QoS 1/2 +messages) indefinitely; with MQTT 5 the session still expires on disconnect, since this +component does not set a session expiry interval. + === Client identifier A custom MQTT client identifier can be configured using the `clientId` option: diff --git a/components/camel-hivemq/src/generated/resources/META-INF/org/apache/camel/component/hivemq/hivemq.json b/components/camel-hivemq/src/generated/resources/META-INF/org/apache/camel/component/hivemq/hivemq.json index 0dbbee22aad2..8d0a688a583d 100644 --- a/components/camel-hivemq/src/generated/resources/META-INF/org/apache/camel/component/hivemq/hivemq.json +++ b/components/camel-hivemq/src/generated/resources/META-INF/org/apache/camel/component/hivemq/hivemq.json @@ -24,7 +24,7 @@ "remote": true }, "componentProperties": { - "cleanStart": { "index": 0, "kind": "property", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 a [...] + "cleanStart": { "index": 0, "kind": "property", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 a [...] "clientId": { "index": 1, "kind": "property", "displayName": "Client Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Client identifier used when connecting to the HiveMQ broker." }, "configuration": { "index": 2, "kind": "property", "displayName": "Configuration", "group": "common", "label": "", "required": false, "type": "object", "javaType": "org.apache.camel.component.hivemq.HiveMQConfiguration", "deprecated": false, "autowired": false, "secret": false, "description": "Component configuration." }, "host": { "index": 3, "kind": "property", "displayName": "Host", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "localhost", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Hostname or IP address of the HiveMQ MQTT broker." }, @@ -47,7 +47,7 @@ }, "properties": { "topic": { "index": 0, "kind": "path", "displayName": "Topic", "group": "common", "label": "", "required": true, "type": "string", "javaType": "java.lang.String", "deprecated": false, "deprecationNote": "", "autowired": false, "secret": false, "description": "The MQTT topic name or pattern to subscribe to or publish on." }, - "cleanStart": { "index": 1, "kind": "parameter", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 [...] + "cleanStart": { "index": 1, "kind": "parameter", "displayName": "Clean Start", "group": "common", "label": "", "required": false, "type": "boolean", "javaType": "boolean", "deprecated": false, "autowired": false, "secret": false, "defaultValue": true, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Whether to initiate a clean session upon connecting to the broker (called clean session in MQTT 3.1.1 [...] "clientId": { "index": 2, "kind": "parameter", "displayName": "Client Id", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Client identifier used when connecting to the HiveMQ broker." }, "host": { "index": 3, "kind": "parameter", "displayName": "Host", "group": "common", "label": "", "required": false, "type": "string", "javaType": "java.lang.String", "deprecated": false, "autowired": false, "secret": false, "defaultValue": "localhost", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "Hostname or IP address of the HiveMQ MQTT broker." }, "mqttVersion": { "index": 4, "kind": "parameter", "displayName": "Mqtt Version", "group": "common", "label": "", "required": false, "type": "enum", "javaType": "com.hivemq.client.mqtt.MqttVersion", "enum": [ "MQTT_3_1_1", "MQTT_5_0" ], "deprecated": false, "autowired": false, "secret": false, "defaultValue": "MQTT_5_0", "configurationClass": "org.apache.camel.component.hivemq.HiveMQConfiguration", "configurationField": "configuration", "description": "The MQTT protocol version to use [...] diff --git a/components/camel-hivemq/src/main/docs/hivemq-component.adoc b/components/camel-hivemq/src/main/docs/hivemq-component.adoc index 0121e4ce2adb..6438de7e6a8f 100644 --- a/components/camel-hivemq/src/main/docs/hivemq-component.adoc +++ b/components/camel-hivemq/src/main/docs/hivemq-component.adoc @@ -237,6 +237,11 @@ from("hivemq:some/topic" .to("mock:test"); ---- +The `cleanStart` option behaves differently between the two protocol versions when set to +`false`. With MQTT 3.1.1, the broker keeps the session (subscriptions and queued QoS 1/2 +messages) indefinitely; with MQTT 5 the session still expires on disconnect, since this +component does not set a session expiry interval. + === Client identifier A custom MQTT client identifier can be configured using the `clientId` option: diff --git a/components/camel-hivemq/src/main/java/org/apache/camel/component/hivemq/HiveMQConfiguration.java b/components/camel-hivemq/src/main/java/org/apache/camel/component/hivemq/HiveMQConfiguration.java index 158c7fff9541..dd25225ed6f7 100644 --- a/components/camel-hivemq/src/main/java/org/apache/camel/component/hivemq/HiveMQConfiguration.java +++ b/components/camel-hivemq/src/main/java/org/apache/camel/component/hivemq/HiveMQConfiguration.java @@ -64,7 +64,9 @@ public class HiveMQConfiguration implements Cloneable { /** * Whether to initiate a clean session upon connecting to the broker (called "clean session" in MQTT 3.1.1 and - * "clean start" in MQTT 5). + * "clean start" in MQTT 5). The two protocol versions behave differently when this is false: with MQTT 3.1.1 the + * broker keeps the session (subscriptions and queued QoS 1/2 messages) indefinitely, while with MQTT 5 the session + * still expires on disconnect, since this component does not set a session expiry interval. */ @UriParam(defaultValue = "true") private boolean cleanStart = true; diff --git a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HivemqComponentBuilderFactory.java b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HivemqComponentBuilderFactory.java index b13da7ad1ec2..ccc251e311eb 100644 --- a/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HivemqComponentBuilderFactory.java +++ b/dsl/camel-componentdsl/src/generated/java/org/apache/camel/builder/component/dsl/HivemqComponentBuilderFactory.java @@ -53,7 +53,12 @@ public interface HivemqComponentBuilderFactory { /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option is a: <code>boolean</code> type. * diff --git a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HiveMQEndpointBuilderFactory.java b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HiveMQEndpointBuilderFactory.java index 1ebea7ecc53d..d490142e8b9d 100644 --- a/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HiveMQEndpointBuilderFactory.java +++ b/dsl/camel-endpointdsl/src/generated/java/org/apache/camel/builder/endpoint/dsl/HiveMQEndpointBuilderFactory.java @@ -45,7 +45,12 @@ public interface HiveMQEndpointBuilderFactory { } /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option is a: <code>boolean</code> type. * @@ -61,7 +66,12 @@ public interface HiveMQEndpointBuilderFactory { } /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option will be converted to a <code>boolean</code> type. * @@ -428,7 +438,12 @@ public interface HiveMQEndpointBuilderFactory { /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option is a: <code>boolean</code> type. * @@ -444,7 +459,12 @@ public interface HiveMQEndpointBuilderFactory { } /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option will be converted to a <code>boolean</code> type. * @@ -740,7 +760,12 @@ public interface HiveMQEndpointBuilderFactory { /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option is a: <code>boolean</code> type. * @@ -756,7 +781,12 @@ public interface HiveMQEndpointBuilderFactory { } /** * Whether to initiate a clean session upon connecting to the broker - * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). + * (called clean session in MQTT 3.1.1 and clean start in MQTT 5). The + * two protocol versions behave differently when this is false: with + * MQTT 3.1.1 the broker keeps the session (subscriptions and queued QoS + * 1/2 messages) indefinitely, while with MQTT 5 the session still + * expires on disconnect, since this component does not set a session + * expiry interval. * * The option will be converted to a <code>boolean</code> type. *
