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

acosentino 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 57610fbd #2118 Add extend SQS source Kamelet with more parameters 
(#2119)
57610fbd is described below

commit 57610fbd69c4fbb0391e61b10d56312a57ecd48c
Author: Jakub Małek <jakub.stan.ma...@gmail.com>
AuthorDate: Mon Jul 22 11:04:37 2024 +0200

    #2118 Add extend SQS source Kamelet with more parameters (#2119)
    
    * aws-sqs-source Kamelet extended with `maxMessagesPerPoll`, 
`waitTimeSeconds` and `visibilityTimeout` parameters (#2118)
    
    * Fixed aws-sqs-source parameter descriptions and tests (#2118)
---
 kamelets/aws-sqs-source.kamelet.yaml                 | 20 ++++++++++++++++++++
 .../camel/kamelets/catalog/KameletsCatalogTest.java  | 19 ++++++++++++++++++-
 .../resources/kamelets/aws-sqs-source.kamelet.yaml   | 20 ++++++++++++++++++++
 3 files changed, 58 insertions(+), 1 deletion(-)

diff --git a/kamelets/aws-sqs-source.kamelet.yaml 
b/kamelets/aws-sqs-source.kamelet.yaml
index 48b87dc1..989a3467 100644
--- a/kamelets/aws-sqs-source.kamelet.yaml
+++ b/kamelets/aws-sqs-source.kamelet.yaml
@@ -127,6 +127,23 @@ spec:
         description: If greedy is enabled, then the polling will happen 
immediately again, if the previous run polled 1 or more messages.
         type: boolean
         default: false
+      maxMessagesPerPoll:
+        title: Max Messages Per Poll
+        description: The maximum number of messages to return. Amazon SQS 
never returns more messages than this value (however, fewer messages might be 
returned). Valid values 1 to 10. Default 1.
+        type: integer
+        minimum: 1
+        maximum: 10
+        default: 1
+      waitTimeSeconds:
+        title: Wait Time Seconds
+        description: The duration (in seconds) for which the call waits for a 
message to arrive in the queue before returning. If a message is available, the 
call returns sooner than WaitTimeSeconds. If no messages are available and the 
wait time expires, the call does not return a message list.
+        type: integer
+        minimum: 0
+      visibilityTimeout:
+        title: Visibility Timeout
+        description: The duration (in seconds) that the received messages are 
hidden from subsequent retrieve requests after being retrieved by a 
ReceiveMessage request.
+        type: integer
+        minimum: 0
   dataTypes:
     out:
       default: text
@@ -207,5 +224,8 @@ spec:
         overrideEndpoint: "{{overrideEndpoint}}"
         delay: "{{delay}}"
         greedy: "{{greedy}}"
+        maxMessagesPerPoll: "{{maxMessagesPerPoll}}"
+        waitTimeSeconds: "{{waitTimeSeconds}}"
+        visibilityTimeout: "{{visibilityTimeout}}"
       steps:
       - to: "kamelet:sink"
diff --git 
a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
 
b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
index 2d70e0cd..de305ff1 100644
--- 
a/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
+++ 
b/library/camel-kamelets-catalog/src/test/java/org/apache/camel/kamelets/catalog/KameletsCatalogTest.java
@@ -55,8 +55,24 @@ public class KameletsCatalogTest {
     @Test
     void testGetKameletsDefinition() throws Exception {
         Definition props = catalog.getKameletDefinition("aws-sqs-source");
-        assertEquals(14, props.getProperties().keySet().size());
+        assertEquals(17, props.getProperties().keySet().size());
         assertTrue(props.getProperties().containsKey("queueNameOrArn"));
+        assertTrue(props.getProperties().containsKey("deleteAfterRead"));
+        assertTrue(props.getProperties().containsKey("accessKey"));
+        assertTrue(props.getProperties().containsKey("secretKey"));
+        assertTrue(props.getProperties().containsKey("region"));
+        assertTrue(props.getProperties().containsKey("autoCreateQueue"));
+        assertTrue(props.getProperties().containsKey("amazonAWSHost"));
+        assertTrue(props.getProperties().containsKey("protocol"));
+        assertTrue(props.getProperties().containsKey("queueURL"));
+        
assertTrue(props.getProperties().containsKey("useDefaultCredentialsProvider"));
+        assertTrue(props.getProperties().containsKey("uriEndpointOverride"));
+        assertTrue(props.getProperties().containsKey("overrideEndpoint"));
+        assertTrue(props.getProperties().containsKey("delay"));
+        assertTrue(props.getProperties().containsKey("greedy"));
+        assertTrue(props.getProperties().containsKey("maxMessagesPerPoll"));
+        assertTrue(props.getProperties().containsKey("waitTimeSeconds"));
+        assertTrue(props.getProperties().containsKey("visibilityTimeout"));
     }
 
     @Test
@@ -64,6 +80,7 @@ public class KameletsCatalogTest {
         List<String> props = 
catalog.getKameletRequiredProperties("aws-sqs-source");
         assertEquals(2, props.size());
         assertTrue(props.contains("queueNameOrArn"));
+        assertTrue(props.contains("region"));
     }
 
     @Test
diff --git 
a/library/camel-kamelets/src/main/resources/kamelets/aws-sqs-source.kamelet.yaml
 
b/library/camel-kamelets/src/main/resources/kamelets/aws-sqs-source.kamelet.yaml
index 48b87dc1..989a3467 100644
--- 
a/library/camel-kamelets/src/main/resources/kamelets/aws-sqs-source.kamelet.yaml
+++ 
b/library/camel-kamelets/src/main/resources/kamelets/aws-sqs-source.kamelet.yaml
@@ -127,6 +127,23 @@ spec:
         description: If greedy is enabled, then the polling will happen 
immediately again, if the previous run polled 1 or more messages.
         type: boolean
         default: false
+      maxMessagesPerPoll:
+        title: Max Messages Per Poll
+        description: The maximum number of messages to return. Amazon SQS 
never returns more messages than this value (however, fewer messages might be 
returned). Valid values 1 to 10. Default 1.
+        type: integer
+        minimum: 1
+        maximum: 10
+        default: 1
+      waitTimeSeconds:
+        title: Wait Time Seconds
+        description: The duration (in seconds) for which the call waits for a 
message to arrive in the queue before returning. If a message is available, the 
call returns sooner than WaitTimeSeconds. If no messages are available and the 
wait time expires, the call does not return a message list.
+        type: integer
+        minimum: 0
+      visibilityTimeout:
+        title: Visibility Timeout
+        description: The duration (in seconds) that the received messages are 
hidden from subsequent retrieve requests after being retrieved by a 
ReceiveMessage request.
+        type: integer
+        minimum: 0
   dataTypes:
     out:
       default: text
@@ -207,5 +224,8 @@ spec:
         overrideEndpoint: "{{overrideEndpoint}}"
         delay: "{{delay}}"
         greedy: "{{greedy}}"
+        maxMessagesPerPoll: "{{maxMessagesPerPoll}}"
+        waitTimeSeconds: "{{waitTimeSeconds}}"
+        visibilityTimeout: "{{visibilityTimeout}}"
       steps:
       - to: "kamelet:sink"

Reply via email to