You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2021/01/25 17:47:23 UTC

[camel] 02/02: CAMEL-16079 - camel-aws-sns2 does not recognise FIFO queue configured though arn

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

acosentino pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git

commit ad67f10c66c3beb9d0ab715dfb0326531f9ba03a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Mon Jan 25 18:26:34 2021 +0100

    CAMEL-16079 - camel-aws-sns2 does not recognise FIFO queue configured though arn
---
 .../org/apache/camel/component/aws2/sns/Sns2Configuration.java   | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Configuration.java b/components/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Configuration.java
index 37923b8..d23f890 100644
--- a/components/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Configuration.java
+++ b/components/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Configuration.java
@@ -20,6 +20,7 @@ import org.apache.camel.RuntimeCamelException;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.spi.UriParams;
+import org.apache.camel.util.ObjectHelper;
 import software.amazon.awssdk.core.Protocol;
 import software.amazon.awssdk.services.sns.SnsClient;
 
@@ -351,6 +352,12 @@ public class Sns2Configuration implements Cloneable {
     boolean isFifoTopic() {
         // AWS docs suggest this is valid derivation.
         // FIFO topic names must end with .fifo, and standard topic cannot
-        return topicName.endsWith(".fifo") || topicArn.endsWith(".fifo");
+        if (topicName.endsWith(".fifo")) {
+            return true;
+        }
+        if (ObjectHelper.isNotEmpty(topicArn)) {
+            return topicArn.endsWith(".fifo");
+        }
+        return false;
     }
 }