You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/12/08 06:56:53 UTC

[camel] branch main updated: CAMEL-17158- AWS2 - Respect queue delay while sending messages to SQS (#6513)

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.git


The following commit(s) were added to refs/heads/main by this push:
     new 53f6e1c  CAMEL-17158- AWS2 - Respect queue delay while sending messages to SQS (#6513)
53f6e1c is described below

commit 53f6e1c367b075363583918851a6f309ec165462
Author: Zineb BENDHIBA <be...@gmail.com>
AuthorDate: Wed Dec 8 07:55:14 2021 +0100

    CAMEL-17158- AWS2 - Respect queue delay while sending messages to SQS (#6513)
---
 .../java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java    | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
index 790ed8e..d9ec0a3 100644
--- a/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
+++ b/components/camel-aws/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
@@ -247,7 +247,9 @@ public class Sqs2Producer extends DefaultProducer {
             delayValue = headerValue;
         }
         LOG.trace("found delay: {}", delayValue);
-        request.delaySeconds(delayValue == null ? Integer.valueOf(0) : delayValue);
+        if (delayValue != null) {
+            request.delaySeconds(delayValue);
+        }
     }
 
     private void addDelay(SendMessageBatchRequestEntry.Builder request, Exchange exchange) {
@@ -261,7 +263,9 @@ public class Sqs2Producer extends DefaultProducer {
             delayValue = headerValue;
         }
         LOG.trace("found delay: {}", delayValue);
-        request.delaySeconds(delayValue == null ? Integer.valueOf(0) : delayValue);
+        if (delayValue != null) {
+            request.delaySeconds(delayValue);
+        }
     }
 
     protected SqsClient getClient() {