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

davsclaus 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 5284d46c7 chore: the Infinispan Kamelets can connect with TLS, and the 
sink can remove entries and set an expiry (#3170) (#3223)
5284d46c7 is described below

commit 5284d46c7b5e678d44ddf04527fcbedbfd77a021
Author: Claus Ibsen <[email protected]>
AuthorDate: Wed Nov 18 22:34:04 2026 +0100

    chore: the Infinispan Kamelets can connect with TLS, and the sink can 
remove entries and set an expiry (#3170) (#3223)
    
    infinispan-source and infinispan-sink take sslTruststoreLocation,
    sslTruststorePassword and sslSniHostName. They are mapped to the Hot Rod
    client properties trust_store_file_name, trust_store_password and
    sni_host_name through the configurationProperties map option of the
    component, so no bean is needed. Setting the trust store turns on TLS.
    The client does not fall back to the certificates Java trusts, and with
    TLS it checks the host name against the SNI host name, which is then
    required. A PEM file works as a trust store without a password.
    
    infinispan-sink takes operation (PUT, PUTIFABSENT, REPLACE, REMOVE),
    mapped to the operation endpoint option. With REMOVE, an empty body
    deletes the entry, and a body deletes it only when the stored value is
    equal, the body afterwards being true or false.
    
    infinispan-sink takes lifespan and maxIdle, with lifespanTimeUnit and
    maxIdleTimeUnit (SECONDS by default). The component reads them only from
    headers, so the template sets the expiry headers only when lifespan or
    maxIdle is set. The component applies a max idle time only with a
    lifespan, so maxIdle alone is sent with an infinite lifespan (-1).
    
    All new options are optional: with them unset, the endpoint URIs are the
    same as before and no header is set.
    
    Co-authored-by: Claude Opus 5.5 <[email protected]>
---
 .../ROOT/partials/infinispan-sink-description.adoc |  50 +++++++++-
 .../partials/infinispan-source-description.adoc    |  26 ++++-
 kamelets/infinispan-sink.kamelet.yaml              | 107 +++++++++++++++++++--
 kamelets/infinispan-source.kamelet.yaml            |  25 ++++-
 .../main/resources/META-INF/kamelets-index.json    |   6 +-
 .../kamelets/infinispan-sink.kamelet.yaml          | 107 +++++++++++++++++++--
 .../kamelets/infinispan-source.kamelet.yaml        |  25 ++++-
 7 files changed, 321 insertions(+), 25 deletions(-)

diff --git a/docs/modules/ROOT/partials/infinispan-sink-description.adoc 
b/docs/modules/ROOT/partials/infinispan-sink-description.adoc
index 5cd28aa2c..bab586043 100644
--- a/docs/modules/ROOT/partials/infinispan-sink-description.adoc
+++ b/docs/modules/ROOT/partials/infinispan-sink-description.adoc
@@ -6,7 +6,8 @@ This Kamelet uses username and password authentication to 
connect to Infinispan
 
 === Security Configuration
 
-- **Authentication**: Enabled by default (secure: true). It is a login with 
username and password, not TLS: the connection has no TLS.
+- **Authentication**: Enabled by default (secure: true). It is a login with 
username and password, not TLS.
+- **TLS**: Off by default. It is on when **sslTruststoreLocation** is set, and 
**sslSniHostName** is then required. See <<infinispan-sink-tls>>.
 - **SASL Mechanism**: DIGEST-MD5 (default). Recent Infinispan servers do not 
accept it: set `saslMechanism` to `SCRAM-SHA-512`.
 - **Security Realm**: "default" realm
 - **Security Server Name**: "infinispan" (default)
@@ -21,6 +22,53 @@ This Kamelet uses username and password authentication to 
connect to Infinispan
 
 The body of each message is stored as the value in the specified cache, which 
must already exist on the server. The key comes from a header, or is a new 
unique id.
 
+The **operation** option sets what is done with each message:
+
+[width="100%",cols="1,3",options="header"]
+|===
+| Operation | What it does
+| `PUT` (when not set) | Stores the body under the key, and replaces a value 
that is already there.
+| `PUTIFABSENT` | Stores the body only when the key has no value yet.
+| `REPLACE` | Stores the body only when the key already has a value.
+| `REMOVE` | Deletes the entry of the key. With an empty body, it is always 
deleted. With a body, it is deleted only when the value stored is equal to the 
body, and the body afterwards is `true` or `false`.
+|===
+
+=== Expiration
+
+With **lifespan**, an entry is removed that long after it is stored. With 
**maxIdle**, an entry is removed when it has not been read or written for that 
long. Both are in seconds unless **lifespanTimeUnit** or **maxIdleTimeUnit** 
says otherwise, and they can be used together. They apply to `PUT`, 
`PUTIFABSENT` and `REPLACE`.
+
+[[infinispan-sink-tls]]
+=== Example with TLS and Expiration
+
+The Infinispan client checks the certificate of the server against the file in 
**sslTruststoreLocation** only: it does not use the certificates that Java 
trusts by default. The file is a PKCS12 or JKS trust store with its password, 
or a PEM file such as the `ca.crt` of the server, without a password. 
**sslSniHostName** is the host name the certificate of the server is for.
+
+[source,yaml,subs='+attributes,macros']
+----
+- route:
+    from:
+      uri: "kafka:sessions"
+      steps:
+        - setHeader:
+            name: key
+            simple: "$\{header.kafka.KEY}"
+        - to:
+            uri: "kamelet:infinispan-sink"
+            parameters:
+              cacheName: "sessions"
+              hosts: "infinispan.example.com:11222"
+              username: "camel"
+              password: "secret"
+              saslMechanism: "SCRAM-SHA-512"
+              sslTruststoreLocation: "/etc/infinispan/ca.crt"
+              sslSniHostName: "infinispan.example.com"
+              lifespan: 30
+              lifespanTimeUnit: "MINUTES"
+----
+
+Each record is stored under its Kafka key, over TLS, and removed from the 
cache 30 minutes later.
+
+To delete entries instead, set `operation: "REMOVE"` and send messages with an 
empty body and the `key` header.
+
 === Optional Headers
 
 - `key` / `ce-key`: Specify the cache key for the object
diff --git a/docs/modules/ROOT/partials/infinispan-source-description.adoc 
b/docs/modules/ROOT/partials/infinispan-source-description.adoc
index 67a9826f9..c368e7d0f 100644
--- a/docs/modules/ROOT/partials/infinispan-source-description.adoc
+++ b/docs/modules/ROOT/partials/infinispan-source-description.adoc
@@ -6,7 +6,7 @@ This Kamelet uses username and password authentication to 
connect to Infinispan
 
 - Username and password for Infinispan authentication
 - Host information for the Infinispan instance
-- Optionally, security settings (login enabled by default with `secure`; the 
connection has no TLS)
+- Optionally, security settings (login enabled by default with `secure`; TLS 
when `sslTruststoreLocation` is set)
 
 === Output format
 
@@ -23,6 +23,30 @@ The Kamelet requires the following parameters:
 
 Optional parameters:
 - `secure`: If the Infinispan instance is secured or not (default: true)
+- `sslTruststoreLocation`: A trust store (PKCS12 or JKS, with 
`sslTruststorePassword`) or a PEM file with the certificate of the server, or 
of the authority that signed it. Setting it turns on TLS.
+- `sslSniHostName`: The host name the certificate of the server is for. 
Required with `sslTruststoreLocation`.
+
+=== Example with TLS
+
+The Infinispan client checks the certificate of the server against the file in 
`sslTruststoreLocation` only: it does not use the certificates that Java trusts 
by default.
+
+[source,yaml]
+----
+- route:
+    from:
+      uri: "kamelet:infinispan-source"
+      parameters:
+        cacheName: "orders"
+        hosts: "infinispan.example.com:11222"
+        username: "camel"
+        password: "secret"
+        saslMechanism: "SCRAM-SHA-512"
+        sslTruststoreLocation: "/etc/infinispan/truststore.p12"
+        sslTruststorePassword: "changeit"
+        sslSniHostName: "infinispan.example.com"
+      steps:
+        - to: "log:orders"
+----
 
 === Usage example
 
diff --git a/kamelets/infinispan-sink.kamelet.yaml 
b/kamelets/infinispan-sink.kamelet.yaml
index 087e6fa99..e6b2b74ba 100644
--- a/kamelets/infinispan-sink.kamelet.yaml
+++ b/kamelets/infinispan-sink.kamelet.yaml
@@ -31,15 +31,15 @@ spec:
   definition:
     title: "Infinispan Sink"
     description: |-
-      Stores the body of each message under a key in a cache of a remote 
Infinispan server, or in Red Hat Data Grid.
+      Stores the body of each message under a key in a cache of a remote 
Infinispan server, or in Red Hat Data Grid, or removes the entry of the key.
 
-      Use it to share data between applications through an Infinispan cache, 
for example the latest status of each order or a lookup table that other 
services read. To react to the changes in a cache, use `infinispan-source`.
+      Use it to share data between applications through an Infinispan cache, 
for example the latest status of each order or a lookup table that other 
services read, or to keep an entry only for a while, such as a session. To 
react to the changes in a cache, use `infinispan-source`.
 
-      Input: the body is the value to store, as text. The `key` header (or 
`ce-key`) is the key; without one, a new unique id is used as the key, so each 
message adds a new entry. A value that is already under the key is replaced.
+      Input: the body is the value to store, as text. The `key` header (or 
`ce-key`) is the key; without one, a new unique id is used as the key, so each 
message adds a new entry. What is done depends on `operation`. By default 
(`PUT`), a value that is already under the key is replaced. `PUTIFABSENT` keeps 
a value that is already there, and `REPLACE` stores the body only under a key 
that has a value. `REMOVE` deletes the entry of the key: with an empty body 
always, and with a body only w [...]
 
-      Output: when it is used inside a route, the message has no body 
afterwards.
+      Output: when it is used inside a route, the message has no body 
afterwards. With `REMOVE` and a body, the body afterwards is `true` when the 
entry was deleted and `false` when it was not.
 
-      Good to know: the cache must already exist on the server. A body that 
the Infinispan client cannot store, such as a Map, fails the message; turn it 
into JSON text first, for example with `json-serialize-action`. Recent 
Infinispan servers do not accept the default `saslMechanism` of `DIGEST-MD5`: 
set it to `SCRAM-SHA-512`. The connection has no TLS.
+      Good to know: the cache must already exist on the server. A body that 
the Infinispan client cannot store, such as a Map, fails the message; turn it 
into JSON text first, for example with `json-serialize-action`. With `lifespan` 
or `maxIdle`, the entries are removed after that time. Recent Infinispan 
servers do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has TLS only when `sslTruststoreLocation` is 
set, together with `sslSniHostName`.
     required:
       - cacheName
       - hosts
@@ -59,7 +59,7 @@ spec:
         example: "infinispan.example.com:11222"
       secure:
         title: Secure
-        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS.
+        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS; 
`sslTruststoreLocation` does.
         type: boolean
         default: true
       username:
@@ -91,6 +91,53 @@ spec:
         description: The name of the server, used when logging in. Keep the 
default unless your Infinispan administrator changed it.
         type: string
         default: "infinispan"
+      operation:
+        title: Operation
+        description: What to do with each message. `PUT` stores the body under 
the key, and replaces a value that is already there. `PUTIFABSENT` stores it 
only when the key has no value yet. `REPLACE` stores it only when the key 
already has a value. `REMOVE` deletes the entry of the key; with a body, it 
deletes it only when the value stored is equal to the body. When it is not set, 
`PUT` is used.
+        type: string
+        enum: ["PUT", "PUTIFABSENT", "REPLACE", "REMOVE"]
+        example: REMOVE
+      lifespan:
+        title: Lifespan
+        description: How long an entry stays in the cache after it is stored, 
in the unit of `lifespanTimeUnit`. The entry is then removed. When it is not 
set, the entry does not expire, unless the cache on the server sets a lifespan. 
Not used with `REMOVE`.
+        type: integer
+        example: 60
+      lifespanTimeUnit:
+        title: Lifespan Time Unit
+        description: The unit of `lifespan`. Only used when `lifespan` is set.
+        type: string
+        enum: ["MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS"]
+        default: SECONDS
+      maxIdle:
+        title: Max Idle Time
+        description: How long an entry stays in the cache when it is not read 
or written, in the unit of `maxIdleTimeUnit`. The entry is then removed. It 
works with or without `lifespan`. When it is not set, an entry is not removed 
for being idle, unless the cache on the server sets it. Not used with `REMOVE`.
+        type: integer
+        example: 300
+      maxIdleTimeUnit:
+        title: Max Idle Time Unit
+        description: The unit of `maxIdle`. Only used when `maxIdle` is set.
+        type: string
+        enum: ["MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS"]
+        default: SECONDS
+      sslTruststoreLocation:
+        title: Trust Store Location
+        description: The path of a file with the certificate of the server, or 
of the authority that signed it, to connect with TLS. It is a trust store in 
PKCS12 or JKS format, which needs `sslTruststorePassword`, or a PEM file with 
the certificates, such as `ca.crt`, which needs no password. Setting it turns 
on TLS, and `sslSniHostName` is then required. The Infinispan client does not 
use the certificates that Java trusts by default, so a server with a 
certificate from a public authori [...]
+        type: string
+        example: "/etc/infinispan/truststore.p12"
+        pattern: "^[^&?#]+$"
+      sslTruststorePassword:
+        title: Trust Store Password
+        description: The password of the trust store file in 
`sslTruststoreLocation`. Not needed for a PEM file.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      sslSniHostName:
+        title: TLS Server Name
+        description: The host name of the server as its certificate names it, 
such as `infinispan.example.com`. Required with `sslTruststoreLocation`. It is 
sent to the server when the connection starts (SNI), and the certificate of the 
server must be for this name, or the connection fails. Setting it without 
`sslTruststoreLocation` fails at start.
+        type: string
+        example: "infinispan.example.com"
+        pattern: "^[A-Za-z0-9.-]+$"
   dataTypes:
     in:
       headers:
@@ -144,5 +191,51 @@ spec:
             expression:
               simple:
                 expression: "${body}"
+        - choice:
+            when:
+              - expression:
+                  simple:
+                    expression: "'{{?lifespan}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanLifespanTime
+                      expression:
+                        simple:
+                          expression: "{{?lifespan}}"
+                  - setHeader:
+                      name: CamelInfinispanTimeUnit
+                      expression:
+                        simple:
+                          expression: "{{lifespanTimeUnit}}"
+              - expression:
+                  simple:
+                    expression: "'{{?maxIdle}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanLifespanTime
+                      expression:
+                        simple:
+                          expression: "-1"
+                  - setHeader:
+                      name: CamelInfinispanTimeUnit
+                      expression:
+                        simple:
+                          expression: "SECONDS"
+        - choice:
+            when:
+              - expression:
+                  simple:
+                    expression: "'{{?maxIdle}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanMaxIdleTime
+                      expression:
+                        simple:
+                          expression: "{{?maxIdle}}"
+                  - setHeader:
+                      name: CamelInfinispanMaxIdleTimeUnit
+                      expression:
+                        simple:
+                          expression: "{{maxIdleTimeUnit}}"
         - to:
-            uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}"
+            uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&operation={{?operation}}&configurationProperties[trust_store_file_name]={{?sslTruststoreLocation}}&configurationProperties[trust_store_password]=RAW({{?sslTruststorePassword}})&configurationProperties[sni_host_name]={{?sslSniHostName}}"
diff --git a/kamelets/infinispan-source.kamelet.yaml 
b/kamelets/infinispan-source.kamelet.yaml
index 3b1e1af3f..b963f70e3 100644
--- a/kamelets/infinispan-source.kamelet.yaml
+++ b/kamelets/infinispan-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the message has no body: the event is in headers. 
`infinispan-event-type` is the kind of event, such as 
`CLIENT_CACHE_ENTRY_CREATED`, `infinispan-key` the key of the entry, 
`infinispan-cache-name` the name of the cache and `infinispan-entry-version` 
the version of the entry. The same values are in `ce-infinispaneventtype`, 
`ce-infinispankey`, `ce-infinispancachename` and `ce-infinispanentryversion`. 
To read the value, look up the key in the cache.
 
-      Good to know: only the changes made while the integration runs are 
received. The cache must already exist on the server. Recent Infinispan servers 
do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has no TLS.
+      Good to know: only the changes made while the integration runs are 
received. The cache must already exist on the server. Recent Infinispan servers 
do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has TLS only when `sslTruststoreLocation` is 
set, together with `sslSniHostName`.
     required:
       - cacheName
       - hosts
@@ -57,7 +57,7 @@ spec:
         example: "infinispan.example.com:11222"
       secure:
         title: Secure
-        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS.
+        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS; 
`sslTruststoreLocation` does.
         type: boolean
         default: true
       username:
@@ -89,6 +89,25 @@ spec:
         description: The name of the server, used when logging in. Keep the 
default unless your Infinispan administrator changed it.
         type: string
         default: "infinispan"
+      sslTruststoreLocation:
+        title: Trust Store Location
+        description: The path of a file with the certificate of the server, or 
of the authority that signed it, to connect with TLS. It is a trust store in 
PKCS12 or JKS format, which needs `sslTruststorePassword`, or a PEM file with 
the certificates, such as `ca.crt`, which needs no password. Setting it turns 
on TLS, and `sslSniHostName` is then required. The Infinispan client does not 
use the certificates that Java trusts by default, so a server with a 
certificate from a public authori [...]
+        type: string
+        example: "/etc/infinispan/truststore.p12"
+        pattern: "^[^&?#]+$"
+      sslTruststorePassword:
+        title: Trust Store Password
+        description: The password of the trust store file in 
`sslTruststoreLocation`. Not needed for a PEM file.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      sslSniHostName:
+        title: TLS Server Name
+        description: The host name of the server as its certificate names it, 
such as `infinispan.example.com`. Required with `sslTruststoreLocation`. It is 
sent to the server when the connection starts (SNI), and the certificate of the 
server must be for this name, or the connection fails. Setting it without 
`sslTruststoreLocation` fails at start.
+        type: string
+        example: "infinispan.example.com"
+        pattern: "^[A-Za-z0-9.-]+$"
       eventTypes:
         title: Event Types
         description: The kinds of events to receive, separated by commas 
without spaces. `CLIENT_CACHE_ENTRY_CREATED`, `CLIENT_CACHE_ENTRY_MODIFIED`, 
`CLIENT_CACHE_ENTRY_REMOVED` and `CLIENT_CACHE_ENTRY_EXPIRED` are changes of an 
entry; `CLIENT_CACHE_FAILOVER` tells that the connection moved to another 
server of the cluster.
@@ -123,7 +142,7 @@ spec:
       - name: local-infinispan
         type: 
"#class:org.apache.camel.component.infinispan.remote.InfinispanRemoteComponent"
     from:
-      uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&eventTypes={{eventTypes}}"
+      uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&eventTypes={{eventTypes}}&configurationProperties[trust_store_file_name]={{?sslTruststoreLocation}}&configurationProperties[trust_store_password]=RAW({{?sslTruststorePassword}})&configurationProperties[sni_host_name]={{?sslSniHostName}}"
       steps:
         - setHeader:
             name: infinispan-cache-name
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 2b47ba3c9..2a0830e41 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
@@ -1074,8 +1074,8 @@
     "type" : "sink",
     "supportLevel" : "Stable",
     "title" : "Infinispan Sink",
-    "summary" : "Stores the body of each message under a key in a cache of a 
remote Infinispan server, or in Red Hat Data Grid.",
-    "description" : "Stores the body of each message under a key in a cache of 
a remote Infinispan server, or in Red Hat Data Grid.\n\nUse it to share data 
between applications through an Infinispan cache, for example the latest status 
of each order or a lookup table that other services read. To react to the 
changes in a cache, use `infinispan-source`.\n\nInput: the body is the value to 
store, as text. The `key` header (or `ce-key`) is the key; without one, a new 
unique id is used as the [...]
+    "summary" : "Stores the body of each message under a key in a cache of a 
remote Infinispan server, or in Red Hat Data Grid, or removes the entry of the 
key.",
+    "description" : "Stores the body of each message under a key in a cache of 
a remote Infinispan server, or in Red Hat Data Grid, or removes the entry of 
the key.\n\nUse it to share data between applications through an Infinispan 
cache, for example the latest status of each order or a lookup table that other 
services read, or to keep an entry only for a while, such as a session. To 
react to the changes in a cache, use `infinispan-source`.\n\nInput: the body is 
the value to store, as te [...]
     "group" : "Infinispan",
     "namespace" : "Cache",
     "provider" : "Apache Software Foundation"
@@ -1085,7 +1085,7 @@
     "supportLevel" : "Stable",
     "title" : "Infinispan Source",
     "summary" : "Receives an event each time an entry of a cache on a remote 
Infinispan server, or Red Hat Data Grid, is created, changed, removed or 
expires, one message per event.",
-    "description" : "Receives an event each time an entry of a cache on a 
remote Infinispan server, or Red Hat Data Grid, is created, changed, removed or 
expires, one message per event.\n\nUse it to react to changes in a shared 
cache, for example to update a search index or notify another service when a 
value changes. To write to a cache, use `infinispan-sink`.\n\nOutput: the 
message has no body: the event is in headers. `infinispan-event-type` is the 
kind of event, such as `CLIENT_CACHE [...]
+    "description" : "Receives an event each time an entry of a cache on a 
remote Infinispan server, or Red Hat Data Grid, is created, changed, removed or 
expires, one message per event.\n\nUse it to react to changes in a shared 
cache, for example to update a search index or notify another service when a 
value changes. To write to a cache, use `infinispan-sink`.\n\nOutput: the 
message has no body: the event is in headers. `infinispan-event-type` is the 
kind of event, such as `CLIENT_CACHE [...]
     "group" : "Infinispan",
     "namespace" : "Cache",
     "provider" : "Apache Software Foundation"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/infinispan-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/infinispan-sink.kamelet.yaml
index 087e6fa99..e6b2b74ba 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/infinispan-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/infinispan-sink.kamelet.yaml
@@ -31,15 +31,15 @@ spec:
   definition:
     title: "Infinispan Sink"
     description: |-
-      Stores the body of each message under a key in a cache of a remote 
Infinispan server, or in Red Hat Data Grid.
+      Stores the body of each message under a key in a cache of a remote 
Infinispan server, or in Red Hat Data Grid, or removes the entry of the key.
 
-      Use it to share data between applications through an Infinispan cache, 
for example the latest status of each order or a lookup table that other 
services read. To react to the changes in a cache, use `infinispan-source`.
+      Use it to share data between applications through an Infinispan cache, 
for example the latest status of each order or a lookup table that other 
services read, or to keep an entry only for a while, such as a session. To 
react to the changes in a cache, use `infinispan-source`.
 
-      Input: the body is the value to store, as text. The `key` header (or 
`ce-key`) is the key; without one, a new unique id is used as the key, so each 
message adds a new entry. A value that is already under the key is replaced.
+      Input: the body is the value to store, as text. The `key` header (or 
`ce-key`) is the key; without one, a new unique id is used as the key, so each 
message adds a new entry. What is done depends on `operation`. By default 
(`PUT`), a value that is already under the key is replaced. `PUTIFABSENT` keeps 
a value that is already there, and `REPLACE` stores the body only under a key 
that has a value. `REMOVE` deletes the entry of the key: with an empty body 
always, and with a body only w [...]
 
-      Output: when it is used inside a route, the message has no body 
afterwards.
+      Output: when it is used inside a route, the message has no body 
afterwards. With `REMOVE` and a body, the body afterwards is `true` when the 
entry was deleted and `false` when it was not.
 
-      Good to know: the cache must already exist on the server. A body that 
the Infinispan client cannot store, such as a Map, fails the message; turn it 
into JSON text first, for example with `json-serialize-action`. Recent 
Infinispan servers do not accept the default `saslMechanism` of `DIGEST-MD5`: 
set it to `SCRAM-SHA-512`. The connection has no TLS.
+      Good to know: the cache must already exist on the server. A body that 
the Infinispan client cannot store, such as a Map, fails the message; turn it 
into JSON text first, for example with `json-serialize-action`. With `lifespan` 
or `maxIdle`, the entries are removed after that time. Recent Infinispan 
servers do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has TLS only when `sslTruststoreLocation` is 
set, together with `sslSniHostName`.
     required:
       - cacheName
       - hosts
@@ -59,7 +59,7 @@ spec:
         example: "infinispan.example.com:11222"
       secure:
         title: Secure
-        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS.
+        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS; 
`sslTruststoreLocation` does.
         type: boolean
         default: true
       username:
@@ -91,6 +91,53 @@ spec:
         description: The name of the server, used when logging in. Keep the 
default unless your Infinispan administrator changed it.
         type: string
         default: "infinispan"
+      operation:
+        title: Operation
+        description: What to do with each message. `PUT` stores the body under 
the key, and replaces a value that is already there. `PUTIFABSENT` stores it 
only when the key has no value yet. `REPLACE` stores it only when the key 
already has a value. `REMOVE` deletes the entry of the key; with a body, it 
deletes it only when the value stored is equal to the body. When it is not set, 
`PUT` is used.
+        type: string
+        enum: ["PUT", "PUTIFABSENT", "REPLACE", "REMOVE"]
+        example: REMOVE
+      lifespan:
+        title: Lifespan
+        description: How long an entry stays in the cache after it is stored, 
in the unit of `lifespanTimeUnit`. The entry is then removed. When it is not 
set, the entry does not expire, unless the cache on the server sets a lifespan. 
Not used with `REMOVE`.
+        type: integer
+        example: 60
+      lifespanTimeUnit:
+        title: Lifespan Time Unit
+        description: The unit of `lifespan`. Only used when `lifespan` is set.
+        type: string
+        enum: ["MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS"]
+        default: SECONDS
+      maxIdle:
+        title: Max Idle Time
+        description: How long an entry stays in the cache when it is not read 
or written, in the unit of `maxIdleTimeUnit`. The entry is then removed. It 
works with or without `lifespan`. When it is not set, an entry is not removed 
for being idle, unless the cache on the server sets it. Not used with `REMOVE`.
+        type: integer
+        example: 300
+      maxIdleTimeUnit:
+        title: Max Idle Time Unit
+        description: The unit of `maxIdle`. Only used when `maxIdle` is set.
+        type: string
+        enum: ["MILLISECONDS", "SECONDS", "MINUTES", "HOURS", "DAYS"]
+        default: SECONDS
+      sslTruststoreLocation:
+        title: Trust Store Location
+        description: The path of a file with the certificate of the server, or 
of the authority that signed it, to connect with TLS. It is a trust store in 
PKCS12 or JKS format, which needs `sslTruststorePassword`, or a PEM file with 
the certificates, such as `ca.crt`, which needs no password. Setting it turns 
on TLS, and `sslSniHostName` is then required. The Infinispan client does not 
use the certificates that Java trusts by default, so a server with a 
certificate from a public authori [...]
+        type: string
+        example: "/etc/infinispan/truststore.p12"
+        pattern: "^[^&?#]+$"
+      sslTruststorePassword:
+        title: Trust Store Password
+        description: The password of the trust store file in 
`sslTruststoreLocation`. Not needed for a PEM file.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      sslSniHostName:
+        title: TLS Server Name
+        description: The host name of the server as its certificate names it, 
such as `infinispan.example.com`. Required with `sslTruststoreLocation`. It is 
sent to the server when the connection starts (SNI), and the certificate of the 
server must be for this name, or the connection fails. Setting it without 
`sslTruststoreLocation` fails at start.
+        type: string
+        example: "infinispan.example.com"
+        pattern: "^[A-Za-z0-9.-]+$"
   dataTypes:
     in:
       headers:
@@ -144,5 +191,51 @@ spec:
             expression:
               simple:
                 expression: "${body}"
+        - choice:
+            when:
+              - expression:
+                  simple:
+                    expression: "'{{?lifespan}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanLifespanTime
+                      expression:
+                        simple:
+                          expression: "{{?lifespan}}"
+                  - setHeader:
+                      name: CamelInfinispanTimeUnit
+                      expression:
+                        simple:
+                          expression: "{{lifespanTimeUnit}}"
+              - expression:
+                  simple:
+                    expression: "'{{?maxIdle}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanLifespanTime
+                      expression:
+                        simple:
+                          expression: "-1"
+                  - setHeader:
+                      name: CamelInfinispanTimeUnit
+                      expression:
+                        simple:
+                          expression: "SECONDS"
+        - choice:
+            when:
+              - expression:
+                  simple:
+                    expression: "'{{?maxIdle}}' != ''"
+                steps:
+                  - setHeader:
+                      name: CamelInfinispanMaxIdleTime
+                      expression:
+                        simple:
+                          expression: "{{?maxIdle}}"
+                  - setHeader:
+                      name: CamelInfinispanMaxIdleTimeUnit
+                      expression:
+                        simple:
+                          expression: "{{maxIdleTimeUnit}}"
         - to:
-            uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}"
+            uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&operation={{?operation}}&configurationProperties[trust_store_file_name]={{?sslTruststoreLocation}}&configurationProperties[trust_store_password]=RAW({{?sslTruststorePassword}})&configurationProperties[sni_host_name]={{?sslSniHostName}}"
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/infinispan-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/infinispan-source.kamelet.yaml
index 3b1e1af3f..b963f70e3 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/infinispan-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/infinispan-source.kamelet.yaml
@@ -37,7 +37,7 @@ spec:
 
       Output: the message has no body: the event is in headers. 
`infinispan-event-type` is the kind of event, such as 
`CLIENT_CACHE_ENTRY_CREATED`, `infinispan-key` the key of the entry, 
`infinispan-cache-name` the name of the cache and `infinispan-entry-version` 
the version of the entry. The same values are in `ce-infinispaneventtype`, 
`ce-infinispankey`, `ce-infinispancachename` and `ce-infinispanentryversion`. 
To read the value, look up the key in the cache.
 
-      Good to know: only the changes made while the integration runs are 
received. The cache must already exist on the server. Recent Infinispan servers 
do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has no TLS.
+      Good to know: only the changes made while the integration runs are 
received. The cache must already exist on the server. Recent Infinispan servers 
do not accept the default `saslMechanism` of `DIGEST-MD5`: set it to 
`SCRAM-SHA-512`. The connection has TLS only when `sslTruststoreLocation` is 
set, together with `sslSniHostName`.
     required:
       - cacheName
       - hosts
@@ -57,7 +57,7 @@ spec:
         example: "infinispan.example.com:11222"
       secure:
         title: Secure
-        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS.
+        description: If true, it logs in with `username` and `password`. Set 
it to false only for a server that needs no login. It does not turn on TLS; 
`sslTruststoreLocation` does.
         type: boolean
         default: true
       username:
@@ -89,6 +89,25 @@ spec:
         description: The name of the server, used when logging in. Keep the 
default unless your Infinispan administrator changed it.
         type: string
         default: "infinispan"
+      sslTruststoreLocation:
+        title: Trust Store Location
+        description: The path of a file with the certificate of the server, or 
of the authority that signed it, to connect with TLS. It is a trust store in 
PKCS12 or JKS format, which needs `sslTruststorePassword`, or a PEM file with 
the certificates, such as `ca.crt`, which needs no password. Setting it turns 
on TLS, and `sslSniHostName` is then required. The Infinispan client does not 
use the certificates that Java trusts by default, so a server with a 
certificate from a public authori [...]
+        type: string
+        example: "/etc/infinispan/truststore.p12"
+        pattern: "^[^&?#]+$"
+      sslTruststorePassword:
+        title: Trust Store Password
+        description: The password of the trust store file in 
`sslTruststoreLocation`. Not needed for a PEM file.
+        type: string
+        format: password
+        x-descriptors:
+        - urn:camel:group:credentials
+      sslSniHostName:
+        title: TLS Server Name
+        description: The host name of the server as its certificate names it, 
such as `infinispan.example.com`. Required with `sslTruststoreLocation`. It is 
sent to the server when the connection starts (SNI), and the certificate of the 
server must be for this name, or the connection fails. Setting it without 
`sslTruststoreLocation` fails at start.
+        type: string
+        example: "infinispan.example.com"
+        pattern: "^[A-Za-z0-9.-]+$"
       eventTypes:
         title: Event Types
         description: The kinds of events to receive, separated by commas 
without spaces. `CLIENT_CACHE_ENTRY_CREATED`, `CLIENT_CACHE_ENTRY_MODIFIED`, 
`CLIENT_CACHE_ENTRY_REMOVED` and `CLIENT_CACHE_ENTRY_EXPIRED` are changes of an 
entry; `CLIENT_CACHE_FAILOVER` tells that the connection moved to another 
server of the cluster.
@@ -123,7 +142,7 @@ spec:
       - name: local-infinispan
         type: 
"#class:org.apache.camel.component.infinispan.remote.InfinispanRemoteComponent"
     from:
-      uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&eventTypes={{eventTypes}}"
+      uri: 
"{{local-infinispan}}:{{cacheName}}?hosts={{hosts}}&secure={{secure}}&username={{username}}&password={{password}}&saslMechanism={{saslMechanism}}&securityRealm={{securityRealm}}&securityServerName={{securityServerName}}&eventTypes={{eventTypes}}&configurationProperties[trust_store_file_name]={{?sslTruststoreLocation}}&configurationProperties[trust_store_password]=RAW({{?sslTruststorePassword}})&configurationProperties[sni_host_name]={{?sslSniHostName}}"
       steps:
         - setHeader:
             name: infinispan-cache-name

Reply via email to