This is an automated email from the ASF dual-hosted git repository.

oscerd pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel-kamelets.git


The following commit(s) were added to refs/heads/main by this push:
     new ff2cdcfe1 chore: the MQTT Kamelets take qos, retained and a TLS trust 
store (#3170) (#3194)
ff2cdcfe1 is described below

commit ff2cdcfe1555b7ea7b990dfcd4f23b37d97a44c3
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 15:11:09 2026 +0100

    chore: the MQTT Kamelets take qos, retained and a TLS trust store (#3170) 
(#3194)
    
    mqtt-source, mqtt-sink, mqtt5-source and mqtt5-sink take an optional
    `qos` (0, 1 or 2), the sinks an optional `retained`, and all four an
    optional `sslTruststoreLocation` and `sslTruststorePassword`, for a
    broker with a certificate from a private or self-signed authority.
    
    The component default of `qos` is already 2 and of `retained` false,
    so the new options lower the quality of service or retain messages;
    they do not change what the Kamelets did. All options use optional
    placeholders and have no `default`, so with them unset the endpoint
    URI is the same as before.
    
    The trust store goes to Paho as the `com.ibm.ssl.trustStore` and
    `com.ibm.ssl.trustStorePassword` entries of the `sslClientProps`
    Properties option, set from the URI as `sslClientProps[key]`, so no
    bean is needed. The Kamelet validator of the Maven plugin now accepts
    `option[key]` for an endpoint option that is a Map or Properties.
    
    Verified with Camel JBang 4.24.0-SNAPSHOT against Eclipse Mosquitto 2
    with a plain and a TLS listener.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../ROOT/partials/mqtt-sink-description.adoc       | 45 ++++++++++++++++++++-
 .../ROOT/partials/mqtt-source-description.adoc     | 29 ++++++++++++-
 .../ROOT/partials/mqtt5-sink-description.adoc      | 47 +++++++++++++++++++++-
 .../ROOT/partials/mqtt5-source-description.adoc    | 31 +++++++++++++-
 kamelets/mqtt-sink.kamelet.yaml                    | 30 +++++++++++++-
 kamelets/mqtt-source.kamelet.yaml                  | 25 +++++++++++-
 kamelets/mqtt5-sink.kamelet.yaml                   | 30 +++++++++++++-
 kamelets/mqtt5-source.kamelet.yaml                 | 25 +++++++++++-
 .../main/resources/META-INF/kamelets-index.json    |  8 ++--
 .../main/resources/kamelets/mqtt-sink.kamelet.yaml | 30 +++++++++++++-
 .../resources/kamelets/mqtt-source.kamelet.yaml    | 25 +++++++++++-
 .../resources/kamelets/mqtt5-sink.kamelet.yaml     | 30 +++++++++++++-
 .../resources/kamelets/mqtt5-source.kamelet.yaml   | 25 +++++++++++-
 .../maven/plugin/ValidateKameletsMojo.java         | 11 ++++-
 14 files changed, 365 insertions(+), 26 deletions(-)

diff --git a/docs/modules/ROOT/partials/mqtt-sink-description.adoc 
b/docs/modules/ROOT/partials/mqtt-sink-description.adoc
index b9c367264..306e049ba 100644
--- a/docs/modules/ROOT/partials/mqtt-sink-description.adoc
+++ b/docs/modules/ROOT/partials/mqtt-sink-description.adoc
@@ -27,4 +27,47 @@ MQTT's lightweight nature makes it ideal for:
 
 === Quality of Service
 
-MQTT supports different Quality of Service levels for message delivery 
guarantees. This Kamelet publishes every message with QoS 2 (exactly once), not 
retained, and has no option to change that.
\ No newline at end of file
+MQTT supports different Quality of Service levels for message delivery 
guarantees. Set them with `qos`:
+
+- **QoS 0**: at most once, with no confirmation from the broker
+- **QoS 1**: at least once; a message can arrive twice
+- **QoS 2**: exactly once (used when `qos` is not set)
+
+A subscriber receives each message with the lower of this and the QoS it 
subscribed with.
+
+=== Retained Messages
+
+With `retained: true`, the broker keeps the last message of the topic and 
gives it to every client that subscribes to the topic later, for example the 
last known state of a device. Each retained message replaces the one before. 
When `retained` is not set, the broker does not keep the messages.
+
+=== TLS with a Private Certificate Authority
+
+With an `ssl://` address the Kamelet connects with TLS, checks the certificate 
and the host name of the broker, and trusts the certificate authorities that 
Java trusts by default. When the broker has a certificate from a private or 
self-signed authority, put the certificate of that authority in a trust store 
file (JKS or PKCS12) and set `sslTruststoreLocation` and 
`sslTruststorePassword`. The Kamelet then trusts the authorities in that file 
instead.
+
+[source,bash]
+----
+keytool -importcert -alias mqtt-ca -file ca.crt -keystore truststore.jks 
-storepass changeit
+----
+
+=== Example with QoS 1, Retained and TLS
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kamelet:timer-source"
+      parameters:
+        message: "online"
+        period: 60000
+      steps:
+        - to:
+            uri: "kamelet:mqtt-sink"
+            parameters:
+              topic: "devices/gateway-1/status"
+              brokerUrl: "ssl://mqtt.example.com:8883"
+              username: "mqttuser"
+              password: "mqttpass"
+              qos: 1
+              retained: true
+              sslTruststoreLocation: "/etc/mqtt/truststore.jks"
+              sslTruststorePassword: "changeit"
+----
\ No newline at end of file
diff --git a/docs/modules/ROOT/partials/mqtt-source-description.adoc 
b/docs/modules/ROOT/partials/mqtt-source-description.adoc
index d3336b4a8..fd96db440 100644
--- a/docs/modules/ROOT/partials/mqtt-source-description.adoc
+++ b/docs/modules/ROOT/partials/mqtt-source-description.adoc
@@ -13,8 +13,10 @@ The MQTT Source Kamelet supports the following 
configurations:
 - **Username**: Username for MQTT authentication (optional)
 - **Password**: Password for MQTT authentication (optional)
 - **Client ID**: MQTT client identifier; a unique one is generated when it is 
not set. Two clients with the same ID push each other off the broker.
+- **Quality of Service** (`qos`): the highest QoS to receive messages with, 0, 
1 or 2; 2 when it is not set
+- **SSL Truststore Location** and **SSL Truststore Password**: a trust store 
file (JKS or PKCS12) with the certificate authority of the broker, for an 
`ssl://` broker with a certificate from a private or self-signed authority
 
-The Kamelet subscribes with QoS 2 and a clean session, so it receives only the 
messages published while it is connected. It has no options to change the QoS 
or the session.
+The Kamelet subscribes with a clean session, so it receives only the messages 
published while it is connected, plus, when it subscribes, the last retained 
message of each matching topic. It has no option to change the session.
 
 === Output Format
 
@@ -57,6 +59,13 @@ The Kamelet outputs the MQTT message payload as bytes, with 
the `CamelMqttTopic`
 
 === Example with SSL/TLS
 
+With an `ssl://` address the Kamelet connects with TLS, checks the certificate 
and the host name of the broker, and trusts the certificate authorities that 
Java trusts by default. When the broker has a certificate from a private or 
self-signed authority, put the certificate of that authority in a trust store 
file and set `sslTruststoreLocation` and `sslTruststorePassword`; the Kamelet 
then trusts the authorities in that file instead.
+
+[source,bash]
+----
+keytool -importcert -alias mqtt-ca -file ca.crt -keystore truststore.jks 
-storepass changeit
+----
+
 [source,yaml,subs='+attributes,macros']
 ----
 - route:
@@ -67,6 +76,8 @@ The Kamelet outputs the MQTT message payload as bytes, with 
the `CamelMqttTopic`
         brokerUrl: "ssl://mqtt.example.com:8883"
         username: "mqttuser"
         password: "mqttpass"
+        sslTruststoreLocation: "/etc/mqtt/truststore.jks"
+        sslTruststorePassword: "changeit"
       steps:
         - to:
             uri: "kamelet:log-sink"
@@ -78,4 +89,18 @@ The Kamelet outputs the MQTT message payload as bytes, with 
the `CamelMqttTopic`
 - **QoS 1**: At least once delivery (acknowledged delivery)
 - **QoS 2**: Exactly once delivery (assured delivery)
 
-The Kamelet subscribes with QoS 2; a message is received with the lower of 
that and the QoS it was published with.
+The Kamelet subscribes with the QoS in `qos`, or 2 when it is not set; a 
message is received with the lower of that and the QoS it was published with. 
The `CamelMqttQoS` header tells which.
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kamelet:mqtt-source"
+      parameters:
+        topic: "sensors/#"
+        brokerUrl: "tcp://mqtt.example.com:1883"
+        qos: 1
+      steps:
+        - to:
+            uri: "kamelet:log-sink"
+----
diff --git a/docs/modules/ROOT/partials/mqtt5-sink-description.adoc 
b/docs/modules/ROOT/partials/mqtt5-sink-description.adoc
index b361c5c4e..50e20aea7 100644
--- a/docs/modules/ROOT/partials/mqtt5-sink-description.adoc
+++ b/docs/modules/ROOT/partials/mqtt5-sink-description.adoc
@@ -27,4 +27,49 @@ Publishes messages to specified MQTT topics, enabling 
reliable message delivery
 
 === Lightweight Protocol
 
-MQTT is designed for lightweight, low-bandwidth, and unreliable network 
scenarios, making it ideal for IoT devices and mobile applications.
\ No newline at end of file
+MQTT is designed for lightweight, low-bandwidth, and unreliable network 
scenarios, making it ideal for IoT devices and mobile applications.
+
+=== Quality of Service
+
+Set the Quality of Service of the messages with `qos`:
+
+- **QoS 0**: at most once, with no confirmation from the broker
+- **QoS 1**: at least once; a message can arrive twice
+- **QoS 2**: exactly once (used when `qos` is not set)
+
+A subscriber receives each message with the lower of this and the QoS it 
subscribed with.
+
+=== Retained Messages
+
+With `retained: true`, the broker keeps the last message of the topic and 
gives it to every client that subscribes to the topic later, for example the 
last known state of a device. Each retained message replaces the one before. 
When `retained` is not set, the broker does not keep the messages.
+
+=== TLS with a Private Certificate Authority
+
+With an `ssl://` address the Kamelet connects with TLS, checks the certificate 
and the host name of the broker, and trusts the certificate authorities that 
Java trusts by default. When the broker has a certificate from a private or 
self-signed authority, put the certificate of that authority in a trust store 
file (JKS or PKCS12) and set `sslTruststoreLocation` and 
`sslTruststorePassword`. The Kamelet then trusts the authorities in that file 
instead.
+
+[source,bash]
+----
+keytool -importcert -alias mqtt-ca -file ca.crt -keystore truststore.jks 
-storepass changeit
+----
+
+=== Example with QoS 1, Retained and TLS
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kamelet:timer-source"
+      parameters:
+        message: "online"
+        period: 60000
+      steps:
+        - to:
+            uri: "kamelet:mqtt5-sink"
+            parameters:
+              topic: "devices/gateway-1/status"
+              brokerUrl: "ssl://mqtt.example.com:8883"
+              qos: 1
+              retained: true
+              sslTruststoreLocation: "/etc/mqtt/truststore.jks"
+              sslTruststorePassword: "changeit"
+----
\ No newline at end of file
diff --git a/docs/modules/ROOT/partials/mqtt5-source-description.adoc 
b/docs/modules/ROOT/partials/mqtt5-source-description.adoc
index 9231443c4..c11ae06f4 100644
--- a/docs/modules/ROOT/partials/mqtt5-source-description.adoc
+++ b/docs/modules/ROOT/partials/mqtt5-source-description.adoc
@@ -3,7 +3,10 @@
 === Authentication
 
 The Kamelet logs in to the broker with `username` and `password`, or without a 
login when they are not set. For TLS,
-use an `ssl://` address in `brokerUrl`.
+use an `ssl://` address in `brokerUrl`. The Kamelet then checks the 
certificate and the host name of the broker, and
+trusts the certificate authorities that Java trusts by default. When the 
broker has a certificate from a private or
+self-signed authority, put the certificate of that authority in a trust store 
file (JKS or PKCS12) and set
+`sslTruststoreLocation` and `sslTruststorePassword`; the Kamelet then trusts 
the authorities in that file instead.
 
 === Output format
 
@@ -16,6 +19,13 @@ message, `CamelMqttQoS` its quality of service, and 
`CamelPahoMqtt5MsgProperties
 - `brokerUrl`: the address of the broker, such as `tcp://mosquitto:1883`
 - `clientId`: the client ID; a unique one is generated when it is not set
 - `username` and `password`: the login, when the broker needs one
+- `qos`: the highest quality of service to receive messages with, 0, 1 or 2; 2 
when it is not set. A message is
+  received with the lower of this and the quality of service it was published 
with, which `CamelMqttQoS` tells
+- `sslTruststoreLocation` and `sslTruststorePassword`: the trust store with 
the certificate authority of the broker,
+  for an `ssl://` broker with a certificate from a private or self-signed 
authority
+
+The Kamelet receives only the messages published while it is connected, plus, 
when it subscribes, the last retained
+message of each matching topic.
 
 === Usage example
 
@@ -32,3 +42,22 @@ message, `CamelMqttQoS` its quality of service, and 
`CamelPahoMqtt5MsgProperties
         - to:
             uri: "kamelet:log-sink"
 ----
+
+=== Example with QoS 1 and TLS
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kamelet:mqtt5-source"
+      parameters:
+        topic: "sensors/#"
+        brokerUrl: "ssl://mosquitto:8883"
+        clientId: "sensor-reader-1"
+        qos: 1
+        sslTruststoreLocation: "/etc/mqtt/truststore.jks"
+        sslTruststorePassword: "changeit"
+      steps:
+        - to:
+            uri: "kamelet:log-sink"
+----
diff --git a/kamelets/mqtt-sink.kamelet.yaml b/kamelets/mqtt-sink.kamelet.yaml
index c438c3a24..c4f215efb 100644
--- a/kamelets/mqtt-sink.kamelet.yaml
+++ b/kamelets/mqtt-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: messages are published with quality of service 2 (exactly 
once) and are not retained by the broker. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. It connects when the integration starts, and 
the integration fails to start when the broker cannot be reached.
+      Good to know: messages are published with quality of service 2 (exactly 
once) unless `qos` is set, and the broker does not keep them for clients that 
subscribe later unless `retained` is true. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. With TLS it checks the certificate and the 
host name of the broker, and trusts the certificate authorities that Java 
trusts by default, or instead the ones in `sslTruststoreLocation`. It connects 
when the integration starts, and [...]
     required:
     - topic
     - brokerUrl
@@ -52,7 +52,7 @@ spec:
         example: "sensors/temperature"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       username:
@@ -68,6 +68,28 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The quality of service to publish each message with: 0 
(at most once, with no confirmation from the broker), 1 (at least once, a 
message can arrive twice) or 2 (exactly once). When it is not set, 2 is used. A 
subscriber receives the message with the lower of this and the quality of 
service it subscribed with."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      retained:
+        title: "Retained"
+        description: "Whether the broker keeps the message as the last one of 
the topic, and gives it to every client that subscribes to the topic later, 
such as the last known state of a device. Each retained message replaces the 
one before. When it is not set, messages are not retained."
+        type: boolean
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dependencies:
     - "camel:paho"
     - "camel:kamelet"
@@ -82,3 +104,7 @@ spec:
               brokerUrl: "{{brokerUrl}}"
               password: "RAW({{?password}})"
               userName: "RAW({{?username}})"
+              qos: "{{?qos}}"
+              retained: "{{?retained}}"
+              "sslClientProps[com.ibm.ssl.trustStore]": 
"{{?sslTruststoreLocation}}"
+              "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
diff --git a/kamelets/mqtt-source.kamelet.yaml 
b/kamelets/mqtt-source.kamelet.yaml
index 199305526..969c68ac8 100644
--- a/kamelets/mqtt-source.kamelet.yaml
+++ b/kamelets/mqtt-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is the payload, as bytes. The `CamelMqttTopic` header 
is the topic the message was published to, and `CamelMqttQoS` its quality of 
service.
 
-      Good to know: it receives only the messages published while it is 
connected. Each running copy needs its own `clientId`: two clients with the 
same ID keep pushing each other off the broker and lose messages. When it is 
not set, a unique one is generated. It connects with no TLS unless `brokerUrl` 
starts with `ssl://`, and the integration fails to start when the broker cannot 
be reached.
+      Good to know: it receives only the messages published while it is 
connected, plus, when it subscribes, the last retained message of each matching 
topic. It subscribes with quality of service 2 (exactly once) unless `qos` is 
set. Each running copy needs its own `clientId`: two clients with the same ID 
keep pushing each other off the broker and lose messages. When it is not set, a 
unique one is generated. It connects with no TLS unless `brokerUrl` starts with 
`ssl://`. With TLS it ch [...]
     required:
     - topic
     - brokerUrl
@@ -50,7 +50,7 @@ spec:
         example: "sensors/#"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       clientId:
@@ -71,6 +71,24 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The highest quality of service to receive messages with: 
0 (at most once, with no confirmation), 1 (at least once, a message can arrive 
twice) or 2 (exactly once). The broker sends each message with the lower of 
this and the quality of service it was published with, which the `CamelMqttQoS` 
header tells. When it is not set, 2 is used."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dataTypes:
     out:
       headers:
@@ -94,6 +112,9 @@ spec:
         clientId: "{{?clientId}}"
         password: "RAW({{?password}})"
         userName: "RAW({{?username}})"
+        qos: "{{?qos}}"
+        "sslClientProps[com.ibm.ssl.trustStore]": "{{?sslTruststoreLocation}}"
+        "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
       steps:
         - to:
             uri: kamelet:sink
diff --git a/kamelets/mqtt5-sink.kamelet.yaml b/kamelets/mqtt5-sink.kamelet.yaml
index 3bcc6dfc8..c193c2ea6 100644
--- a/kamelets/mqtt5-sink.kamelet.yaml
+++ b/kamelets/mqtt5-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: messages are published with quality of service 2 (exactly 
once) and are not retained by the broker. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. It connects when the integration starts, and 
the integration fails to start when the broker cannot be reached.
+      Good to know: messages are published with quality of service 2 (exactly 
once) unless `qos` is set, and the broker does not keep them for clients that 
subscribe later unless `retained` is true. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. With TLS it checks the certificate and the 
host name of the broker, and trusts the certificate authorities that Java 
trusts by default, or instead the ones in `sslTruststoreLocation`. It connects 
when the integration starts, and [...]
     required:
     - topic
     - brokerUrl
@@ -52,7 +52,7 @@ spec:
         example: "sensors/temperature"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       username:
@@ -68,6 +68,28 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The quality of service to publish each message with: 0 
(at most once, with no confirmation from the broker), 1 (at least once, a 
message can arrive twice) or 2 (exactly once). When it is not set, 2 is used. A 
subscriber receives the message with the lower of this and the quality of 
service it subscribed with."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      retained:
+        title: "Retained"
+        description: "Whether the broker keeps the message as the last one of 
the topic, and gives it to every client that subscribes to the topic later, 
such as the last known state of a device. Each retained message replaces the 
one before. When it is not set, messages are not retained."
+        type: boolean
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dependencies:
     - "camel:paho-mqtt5"
     - "camel:kamelet"
@@ -82,3 +104,7 @@ spec:
               brokerUrl: "{{brokerUrl}}"
               password: "RAW({{?password}})"
               userName: "RAW({{?username}})"
+              qos: "{{?qos}}"
+              retained: "{{?retained}}"
+              "sslClientProps[com.ibm.ssl.trustStore]": 
"{{?sslTruststoreLocation}}"
+              "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
diff --git a/kamelets/mqtt5-source.kamelet.yaml 
b/kamelets/mqtt5-source.kamelet.yaml
index 69383dda4..8a66db456 100644
--- a/kamelets/mqtt5-source.kamelet.yaml
+++ b/kamelets/mqtt5-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is the payload, as bytes. The `CamelMqttTopic` header 
is the topic the message was published to, `CamelMqttQoS` its quality of 
service, and `CamelPahoMqtt5MsgProperties` holds the MQTT 5 properties of the 
message, such as its user properties.
 
-      Good to know: it receives only the messages published while it is 
connected. Each running copy needs its own `clientId`: two clients with the 
same ID keep pushing each other off the broker and lose messages. When it is 
not set, a unique one is generated. It connects with no TLS unless `brokerUrl` 
starts with `ssl://`, and the integration fails to start when the broker cannot 
be reached.
+      Good to know: it receives only the messages published while it is 
connected, plus, when it subscribes, the last retained message of each matching 
topic. It subscribes with quality of service 2 (exactly once) unless `qos` is 
set. Each running copy needs its own `clientId`: two clients with the same ID 
keep pushing each other off the broker and lose messages. When it is not set, a 
unique one is generated. It connects with no TLS unless `brokerUrl` starts with 
`ssl://`. With TLS it ch [...]
     required:
     - topic
     - brokerUrl
@@ -50,7 +50,7 @@ spec:
         example: "sensors/#"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       clientId:
@@ -71,6 +71,24 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The highest quality of service to receive messages with: 
0 (at most once, with no confirmation), 1 (at least once, a message can arrive 
twice) or 2 (exactly once). The broker sends each message with the lower of 
this and the quality of service it was published with, which the `CamelMqttQoS` 
header tells. When it is not set, 2 is used."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dataTypes:
     out:
       headers:
@@ -98,6 +116,9 @@ spec:
         clientId: "{{?clientId}}"
         password: "RAW({{?password}})"
         userName: "RAW({{?username}})"
+        qos: "{{?qos}}"
+        "sslClientProps[com.ibm.ssl.trustStore]": "{{?sslTruststoreLocation}}"
+        "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
       steps:
         - to:
             uri: kamelet:sink
diff --git 
a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json 
b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
index b67c6a43a..6ef37a1e9 100644
--- a/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
+++ b/library/camel-kamelets/src/main/resources/META-INF/kamelets-index.json
@@ -1575,7 +1575,7 @@
     "supportLevel" : "Stable",
     "title" : "MQTT Sink",
     "summary" : "Publishes each message to a topic on an MQTT broker, such as 
Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.",
-    "description" : "Publishes each message to a topic on an MQTT broker, such 
as Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.\n\nUse it to send commands or 
data to IoT devices, or to publish readings and events for MQTT clients to 
receive. For a broker or clients that use MQTT 5, use `mqtt5-sink`.\n\nInput: 
the body is the payload, as text or bytes, and is sent as it is. A Map fails: 
turn it into JSON text first, for example with `json-serialize-action`. The 
headers of the message are  [...]
+    "description" : "Publishes each message to a topic on an MQTT broker, such 
as Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.\n\nUse it to send commands or 
data to IoT devices, or to publish readings and events for MQTT clients to 
receive. For a broker or clients that use MQTT 5, use `mqtt5-sink`.\n\nInput: 
the body is the payload, as text or bytes, and is sent as it is. A Map fails: 
turn it into JSON text first, for example with `json-serialize-action`. The 
headers of the message are  [...]
     "group" : "MQTT",
     "namespace" : "Messaging",
     "provider" : "Apache Software Foundation"
@@ -1585,7 +1585,7 @@
     "supportLevel" : "Stable",
     "title" : "MQTT Source",
     "summary" : "Receives each message published to a topic on an MQTT broker, 
such as Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.",
-    "description" : "Receives each message published to a topic on an MQTT 
broker, such as Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.\n\nUse it to 
collect readings and events from IoT devices and other MQTT clients. A topic 
with wildcards, such as `sensors/#`, receives from many topics at once. For a 
broker or clients that use MQTT 5, use `mqtt5-source`.\n\nOutput: the body is 
the payload, as bytes. The `CamelMqttTopic` header is the topic the message was 
published to, and `CamelMqttQ [...]
+    "description" : "Receives each message published to a topic on an MQTT 
broker, such as Eclipse Mosquitto or HiveMQ, with MQTT 3.1.1.\n\nUse it to 
collect readings and events from IoT devices and other MQTT clients. A topic 
with wildcards, such as `sensors/#`, receives from many topics at once. For a 
broker or clients that use MQTT 5, use `mqtt5-source`.\n\nOutput: the body is 
the payload, as bytes. The `CamelMqttTopic` header is the topic the message was 
published to, and `CamelMqttQ [...]
     "group" : "MQTT",
     "namespace" : "Messaging",
     "provider" : "Apache Software Foundation"
@@ -1595,7 +1595,7 @@
     "supportLevel" : "Stable",
     "title" : "MQTT v5 Sink",
     "summary" : "Publishes each message to a topic on an MQTT broker, such as 
Eclipse Mosquitto or HiveMQ, with MQTT 5.",
-    "description" : "Publishes each message to a topic on an MQTT broker, such 
as Eclipse Mosquitto or HiveMQ, with MQTT 5.\n\nUse it to send commands or data 
to IoT devices, or to publish readings and events, when the broker or the 
clients use MQTT 5. For a broker that only speaks MQTT 3.1.1, use 
`mqtt-sink`.\n\nInput: the body is the payload, as text or bytes, and is sent 
as it is. Turn structured data such as a Map into JSON text first, for example 
with `json-serialize-action`. The he [...]
+    "description" : "Publishes each message to a topic on an MQTT broker, such 
as Eclipse Mosquitto or HiveMQ, with MQTT 5.\n\nUse it to send commands or data 
to IoT devices, or to publish readings and events, when the broker or the 
clients use MQTT 5. For a broker that only speaks MQTT 3.1.1, use 
`mqtt-sink`.\n\nInput: the body is the payload, as text or bytes, and is sent 
as it is. Turn structured data such as a Map into JSON text first, for example 
with `json-serialize-action`. The he [...]
     "group" : "MQTT v5",
     "namespace" : "Messaging",
     "provider" : "Apache Software Foundation"
@@ -1605,7 +1605,7 @@
     "supportLevel" : "Stable",
     "title" : "MQTT 5 Source",
     "summary" : "Receives each message published to a topic on an MQTT broker, 
such as Eclipse Mosquitto or HiveMQ, with MQTT 5.",
-    "description" : "Receives each message published to a topic on an MQTT 
broker, such as Eclipse Mosquitto or HiveMQ, with MQTT 5.\n\nUse it to collect 
readings and events from IoT devices and other MQTT clients, when the broker or 
the clients use MQTT 5. A topic with wildcards, such as `sensors/#`, receives 
from many topics at once. For a broker that only speaks MQTT 3.1.1, use 
`mqtt-source`.\n\nOutput: the body is the payload, as bytes. The 
`CamelMqttTopic` header is the topic the me [...]
+    "description" : "Receives each message published to a topic on an MQTT 
broker, such as Eclipse Mosquitto or HiveMQ, with MQTT 5.\n\nUse it to collect 
readings and events from IoT devices and other MQTT clients, when the broker or 
the clients use MQTT 5. A topic with wildcards, such as `sensors/#`, receives 
from many topics at once. For a broker that only speaks MQTT 3.1.1, use 
`mqtt-source`.\n\nOutput: the body is the payload, as bytes. The 
`CamelMqttTopic` header is the topic the me [...]
     "group" : "MQTT 5",
     "namespace" : "Messaging",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml
index c438c3a24..c4f215efb 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: messages are published with quality of service 2 (exactly 
once) and are not retained by the broker. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. It connects when the integration starts, and 
the integration fails to start when the broker cannot be reached.
+      Good to know: messages are published with quality of service 2 (exactly 
once) unless `qos` is set, and the broker does not keep them for clients that 
subscribe later unless `retained` is true. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. With TLS it checks the certificate and the 
host name of the broker, and trusts the certificate authorities that Java 
trusts by default, or instead the ones in `sslTruststoreLocation`. It connects 
when the integration starts, and [...]
     required:
     - topic
     - brokerUrl
@@ -52,7 +52,7 @@ spec:
         example: "sensors/temperature"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       username:
@@ -68,6 +68,28 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The quality of service to publish each message with: 0 
(at most once, with no confirmation from the broker), 1 (at least once, a 
message can arrive twice) or 2 (exactly once). When it is not set, 2 is used. A 
subscriber receives the message with the lower of this and the quality of 
service it subscribed with."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      retained:
+        title: "Retained"
+        description: "Whether the broker keeps the message as the last one of 
the topic, and gives it to every client that subscribes to the topic later, 
such as the last known state of a device. Each retained message replaces the 
one before. When it is not set, messages are not retained."
+        type: boolean
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dependencies:
     - "camel:paho"
     - "camel:kamelet"
@@ -82,3 +104,7 @@ spec:
               brokerUrl: "{{brokerUrl}}"
               password: "RAW({{?password}})"
               userName: "RAW({{?username}})"
+              qos: "{{?qos}}"
+              retained: "{{?retained}}"
+              "sslClientProps[com.ibm.ssl.trustStore]": 
"{{?sslTruststoreLocation}}"
+              "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml
index 199305526..969c68ac8 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is the payload, as bytes. The `CamelMqttTopic` header 
is the topic the message was published to, and `CamelMqttQoS` its quality of 
service.
 
-      Good to know: it receives only the messages published while it is 
connected. Each running copy needs its own `clientId`: two clients with the 
same ID keep pushing each other off the broker and lose messages. When it is 
not set, a unique one is generated. It connects with no TLS unless `brokerUrl` 
starts with `ssl://`, and the integration fails to start when the broker cannot 
be reached.
+      Good to know: it receives only the messages published while it is 
connected, plus, when it subscribes, the last retained message of each matching 
topic. It subscribes with quality of service 2 (exactly once) unless `qos` is 
set. Each running copy needs its own `clientId`: two clients with the same ID 
keep pushing each other off the broker and lose messages. When it is not set, a 
unique one is generated. It connects with no TLS unless `brokerUrl` starts with 
`ssl://`. With TLS it ch [...]
     required:
     - topic
     - brokerUrl
@@ -50,7 +50,7 @@ spec:
         example: "sensors/#"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       clientId:
@@ -71,6 +71,24 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The highest quality of service to receive messages with: 
0 (at most once, with no confirmation), 1 (at least once, a message can arrive 
twice) or 2 (exactly once). The broker sends each message with the lower of 
this and the quality of service it was published with, which the `CamelMqttQoS` 
header tells. When it is not set, 2 is used."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dataTypes:
     out:
       headers:
@@ -94,6 +112,9 @@ spec:
         clientId: "{{?clientId}}"
         password: "RAW({{?password}})"
         userName: "RAW({{?username}})"
+        qos: "{{?qos}}"
+        "sslClientProps[com.ibm.ssl.trustStore]": "{{?sslTruststoreLocation}}"
+        "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
       steps:
         - to:
             uri: kamelet:sink
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
index 3bcc6dfc8..c193c2ea6 100644
--- a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
+++ b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-sink.kamelet.yaml
@@ -39,7 +39,7 @@ spec:
 
       Output: the message is unchanged.
 
-      Good to know: messages are published with quality of service 2 (exactly 
once) and are not retained by the broker. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. It connects when the integration starts, and 
the integration fails to start when the broker cannot be reached.
+      Good to know: messages are published with quality of service 2 (exactly 
once) unless `qos` is set, and the broker does not keep them for clients that 
subscribe later unless `retained` is true. It connects with no TLS unless 
`brokerUrl` starts with `ssl://`. With TLS it checks the certificate and the 
host name of the broker, and trusts the certificate authorities that Java 
trusts by default, or instead the ones in `sslTruststoreLocation`. It connects 
when the integration starts, and [...]
     required:
     - topic
     - brokerUrl
@@ -52,7 +52,7 @@ spec:
         example: "sensors/temperature"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       username:
@@ -68,6 +68,28 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The quality of service to publish each message with: 0 
(at most once, with no confirmation from the broker), 1 (at least once, a 
message can arrive twice) or 2 (exactly once). When it is not set, 2 is used. A 
subscriber receives the message with the lower of this and the quality of 
service it subscribed with."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      retained:
+        title: "Retained"
+        description: "Whether the broker keeps the message as the last one of 
the topic, and gives it to every client that subscribes to the topic later, 
such as the last known state of a device. Each retained message replaces the 
one before. When it is not set, messages are not retained."
+        type: boolean
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dependencies:
     - "camel:paho-mqtt5"
     - "camel:kamelet"
@@ -82,3 +104,7 @@ spec:
               brokerUrl: "{{brokerUrl}}"
               password: "RAW({{?password}})"
               userName: "RAW({{?username}})"
+              qos: "{{?qos}}"
+              retained: "{{?retained}}"
+              "sslClientProps[com.ibm.ssl.trustStore]": 
"{{?sslTruststoreLocation}}"
+              "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
index 69383dda4..8a66db456 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/mqtt5-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the body is the payload, as bytes. The `CamelMqttTopic` header 
is the topic the message was published to, `CamelMqttQoS` its quality of 
service, and `CamelPahoMqtt5MsgProperties` holds the MQTT 5 properties of the 
message, such as its user properties.
 
-      Good to know: it receives only the messages published while it is 
connected. Each running copy needs its own `clientId`: two clients with the 
same ID keep pushing each other off the broker and lose messages. When it is 
not set, a unique one is generated. It connects with no TLS unless `brokerUrl` 
starts with `ssl://`, and the integration fails to start when the broker cannot 
be reached.
+      Good to know: it receives only the messages published while it is 
connected, plus, when it subscribes, the last retained message of each matching 
topic. It subscribes with quality of service 2 (exactly once) unless `qos` is 
set. Each running copy needs its own `clientId`: two clients with the same ID 
keep pushing each other off the broker and lose messages. When it is not set, a 
unique one is generated. It connects with no TLS unless `brokerUrl` starts with 
`ssl://`. With TLS it ch [...]
     required:
     - topic
     - brokerUrl
@@ -50,7 +50,7 @@ spec:
         example: "sensors/#"
       brokerUrl:
         title: "Broker URL"
-        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883)."
+        description: "The address of the MQTT broker, as `tcp://host:port` 
(usually port 1883), or `ssl://host:port` for TLS (usually port 8883). For a 
broker with a certificate from a private or self-signed authority, also set 
`sslTruststoreLocation`."
         type: string
         example: "tcp://mosquitto:1883"
       clientId:
@@ -71,6 +71,24 @@ spec:
         format: password
         x-descriptors:
         - urn:camel:group:credentials
+      qos:
+        title: "Quality of Service"
+        description: "The highest quality of service to receive messages with: 
0 (at most once, with no confirmation), 1 (at least once, a message can arrive 
twice) or 2 (exactly once). The broker sends each message with the lower of 
this and the quality of service it was published with, which the `CamelMqttQoS` 
header tells. When it is not set, 2 is used."
+        type: integer
+        enum: [0, 1, 2]
+        example: 1
+      sslTruststoreLocation:
+        title: "SSL Truststore Location"
+        description: "The path of a trust store file, in JKS or PKCS12 format, 
with the certificate of the authority that signed the certificate of the 
broker. Needed only with an `ssl://` address when the broker uses a certificate 
that Java does not trust by default, such as one from a private or self-signed 
authority. Not used with `tcp://`."
+        type: string
+        example: "/etc/mqtt/truststore.jks"
+      sslTruststorePassword:
+        title: "SSL Truststore Password"
+        description: "The password of the trust store file in 
`sslTruststoreLocation`."
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
   dataTypes:
     out:
       headers:
@@ -98,6 +116,9 @@ spec:
         clientId: "{{?clientId}}"
         password: "RAW({{?password}})"
         userName: "RAW({{?username}})"
+        qos: "{{?qos}}"
+        "sslClientProps[com.ibm.ssl.trustStore]": "{{?sslTruststoreLocation}}"
+        "sslClientProps[com.ibm.ssl.trustStorePassword]": 
"RAW({{?sslTruststorePassword}})"
       steps:
         - to:
             uri: kamelet:sink
diff --git 
a/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/ValidateKameletsMojo.java
 
b/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/ValidateKameletsMojo.java
index 08d012185..3de2e8fca 100644
--- 
a/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/ValidateKameletsMojo.java
+++ 
b/library/kamelets-maven-plugin/src/main/java/org/apache/camel/kamelets/maven/plugin/ValidateKameletsMojo.java
@@ -136,7 +136,16 @@ public class ValidateKameletsMojo extends AbstractMojo {
                                 // a multi value option takes its entries by 
prefix: mail.imaps.auth.mechanisms on imaps
                                 boolean prefixed = ce.stream().anyMatch(o -> 
o.isMultiValue() && o.getPrefix() != null
                                         && !o.getPrefix().isEmpty() && 
entry.getKey().startsWith(o.getPrefix()));
-                                if (!ceInternal.contains(entry.getKey()) && 
!prefixed) {
+                                // a Map or Properties option takes its 
entries as option[key]:
+                                // sslClientProps[com.ibm.ssl.trustStore] on 
paho
+                                String key = entry.getKey();
+                                int bracket = key.indexOf('[');
+                                boolean mapEntry = bracket > 0 && 
key.endsWith("]")
+                                        && ce.stream().anyMatch(o -> 
o.getName().equals(key.substring(0, bracket))
+                                                && o.getJavaType() != null
+                                                && 
(o.getJavaType().equals("java.util.Properties")
+                                                        || 
o.getJavaType().startsWith("java.util.Map")));
+                                if (!ceInternal.contains(key) && !prefixed && 
!mapEntry) {
                                     getLog().error("Kamelet Name: " + name);
                                     getLog().error("Scheme Name: " + 
cleanName);
                                     getLog().error("Parameter: " + 
entry.getKey());

Reply via email to