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

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

commit 682cf653e10b3b015752f6a1922be9785d57a223
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Tue Jul 16 15:12:33 2024 +0200

    JMS Kamelets: Expose Connection Pool parameters to make it customizable
    
    Signed-off-by: Andrea Cosentino <anco...@gmail.com>
---
 .../jms-pooled-apache-artemis-sink.kamelet.yaml    | 20 +++++++++++++++++++-
 .../jms-pooled-apache-artemis-source.kamelet.yaml  | 22 ++++++++++++++++++++--
 .../jms-pooled-apache-artemis-sink.kamelet.yaml    | 20 +++++++++++++++++++-
 .../jms-pooled-apache-artemis-source.kamelet.yaml  | 22 ++++++++++++++++++++--
 4 files changed, 78 insertions(+), 6 deletions(-)

diff --git a/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml 
b/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
index 2dc76f85..fbb4076c 100644
--- a/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
+++ b/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
@@ -67,7 +67,22 @@ spec:
         x-descriptors:
         - urn:camel:group:credentials
         - urn:keda:authentication:password
-        - urn:keda:required   
+        - urn:keda:required
+      maxSessionsPerConnection:
+        title: "Max Sessions Per Connection"
+        description: "The maximum number of pooled sessions per connection in 
the pool"
+        type: int
+        default: 500 
+      maxIdleSessionsPerConnection:
+        title: "Max Idle Sessions Per Connection"
+        description: "The number of idle sessions allowed per connection 
before they are closed."
+        type: int
+        default: 500
+      connectionIdleTimeout:
+        title: "Connection Idle Timeout"
+        description: "The maximum time a pooled Connection can sit unused 
before it is eligible for removal (in milliseconds)"
+        type: int
+        default: 30000     
   dependencies:
   - "camel:jms"
   - "camel:kamelet"
@@ -85,6 +100,9 @@ spec:
         type: "#class:org.messaginghub.pooled.jms.JmsPoolConnectionFactory"
         properties:
           connectionFactory: '#bean:{{connectionFactoryBean}}'
+          maxSessionsPerConnection: "{{maxSessionsPerConnection}}"
+          maxIdleSessionsPerConnection: "{{maxIdleSessionsPerConnection}}"
+          connectionIdleTimeout: "{{connectionIdleTimeout}}"
     from:
       uri: "kamelet:source"
       steps:
diff --git a/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml 
b/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
index 362a2e64..41b105f0 100644
--- a/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
+++ b/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
@@ -66,7 +66,22 @@ spec:
         x-descriptors:
         - urn:camel:group:credentials
         - urn:keda:authentication:password
-        - urn:keda:required        
+        - urn:keda:required
+      maxSessionsPerConnection:
+        title: "Max Session Per Connection"
+        description: "The maximum number of pooled sessions per connection in 
the pool"
+        type: int
+        default: 500
+      maxIdleSessionsPerConnection:
+        title: "Max Idle Sessions Per Connection"
+        description: "The number of idle sessions allowed per connection 
before they are closed."
+        type: int
+        default: 500
+      connectionIdleTimeout:
+        title: "Connection Idle Timeout"
+        description: "The maximum time a pooled Connection can sit unused 
before it is eligible for removal (in milliseconds)"
+        type: int
+        default: 30000       
   dependencies:
   - "camel:jms"
   - "camel:kamelet"
@@ -83,7 +98,10 @@ spec:
       - name: pooledFactoryBean
         type: "#class:org.messaginghub.pooled.jms.JmsPoolConnectionFactory"
         properties:
-          connectionFactory: '#bean:{{connectionFactoryBean}}'        
+          connectionFactory: '#bean:{{connectionFactoryBean}}'
+          maxSessionsPerConnection: "{{maxSessionsPerConnection}}"
+          maxIdleSessionsPerConnection: "{{maxIdleSessionsPerConnection}}"
+          connectionIdleTimeout: "{{connectionIdleTimeout}}"        
     from:
       uri: "jms:{{destinationType}}:{{destinationName}}"
       parameters:
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
index 2dc76f85..fbb4076c 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-sink.kamelet.yaml
@@ -67,7 +67,22 @@ spec:
         x-descriptors:
         - urn:camel:group:credentials
         - urn:keda:authentication:password
-        - urn:keda:required   
+        - urn:keda:required
+      maxSessionsPerConnection:
+        title: "Max Sessions Per Connection"
+        description: "The maximum number of pooled sessions per connection in 
the pool"
+        type: int
+        default: 500 
+      maxIdleSessionsPerConnection:
+        title: "Max Idle Sessions Per Connection"
+        description: "The number of idle sessions allowed per connection 
before they are closed."
+        type: int
+        default: 500
+      connectionIdleTimeout:
+        title: "Connection Idle Timeout"
+        description: "The maximum time a pooled Connection can sit unused 
before it is eligible for removal (in milliseconds)"
+        type: int
+        default: 30000     
   dependencies:
   - "camel:jms"
   - "camel:kamelet"
@@ -85,6 +100,9 @@ spec:
         type: "#class:org.messaginghub.pooled.jms.JmsPoolConnectionFactory"
         properties:
           connectionFactory: '#bean:{{connectionFactoryBean}}'
+          maxSessionsPerConnection: "{{maxSessionsPerConnection}}"
+          maxIdleSessionsPerConnection: "{{maxIdleSessionsPerConnection}}"
+          connectionIdleTimeout: "{{connectionIdleTimeout}}"
     from:
       uri: "kamelet:source"
       steps:
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
index 362a2e64..41b105f0 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/jms-pooled-apache-artemis-source.kamelet.yaml
@@ -66,7 +66,22 @@ spec:
         x-descriptors:
         - urn:camel:group:credentials
         - urn:keda:authentication:password
-        - urn:keda:required        
+        - urn:keda:required
+      maxSessionsPerConnection:
+        title: "Max Session Per Connection"
+        description: "The maximum number of pooled sessions per connection in 
the pool"
+        type: int
+        default: 500
+      maxIdleSessionsPerConnection:
+        title: "Max Idle Sessions Per Connection"
+        description: "The number of idle sessions allowed per connection 
before they are closed."
+        type: int
+        default: 500
+      connectionIdleTimeout:
+        title: "Connection Idle Timeout"
+        description: "The maximum time a pooled Connection can sit unused 
before it is eligible for removal (in milliseconds)"
+        type: int
+        default: 30000       
   dependencies:
   - "camel:jms"
   - "camel:kamelet"
@@ -83,7 +98,10 @@ spec:
       - name: pooledFactoryBean
         type: "#class:org.messaginghub.pooled.jms.JmsPoolConnectionFactory"
         properties:
-          connectionFactory: '#bean:{{connectionFactoryBean}}'        
+          connectionFactory: '#bean:{{connectionFactoryBean}}'
+          maxSessionsPerConnection: "{{maxSessionsPerConnection}}"
+          maxIdleSessionsPerConnection: "{{maxIdleSessionsPerConnection}}"
+          connectionIdleTimeout: "{{connectionIdleTimeout}}"        
     from:
       uri: "jms:{{destinationType}}:{{destinationName}}"
       parameters:

Reply via email to