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 2020/11/27 18:28:12 UTC

[camel] 01/02: Camel-AWS2-SQS: Guard check for Message Group Id Stategy and Message Deduplication Id Strategy

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 e7b99139ddbffaf5d243638ccb9122b1673b59f7
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Nov 27 18:21:22 2020 +0100

    Camel-AWS2-SQS: Guard check for Message Group Id Stategy and Message Deduplication Id Strategy
---
 .../main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java   | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/components/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java b/components/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
index 682ca49..2bec75b 100644
--- a/components/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
+++ b/components/camel-aws2-sqs/src/main/java/org/apache/camel/component/aws2/sqs/Sqs2Producer.java
@@ -173,14 +173,18 @@ public class Sqs2Producer extends DefaultProducer {
     private void configureFifoAttributes(SendMessageRequest.Builder request, Exchange exchange) {
         if (getEndpoint().getConfiguration().isFifoQueue()) {
             // use strategies
+        	if (ObjectHelper.isNotEmpty(getEndpoint().getConfiguration().getMessageGroupIdStrategy())) {
             MessageGroupIdStrategy messageGroupIdStrategy = getEndpoint().getConfiguration().getMessageGroupIdStrategy();
             String messageGroupId = messageGroupIdStrategy.getMessageGroupId(exchange);
             request.messageGroupId(messageGroupId);
+        	}
 
+        	if (ObjectHelper.isNotEmpty(getEndpoint().getConfiguration().getMessageDeduplicationIdStrategy())) {
             MessageDeduplicationIdStrategy messageDeduplicationIdStrategy
                     = getEndpoint().getConfiguration().getMessageDeduplicationIdStrategy();
             String messageDeduplicationId = messageDeduplicationIdStrategy.getMessageDeduplicationId(exchange);
             request.messageDeduplicationId(messageDeduplicationId);
+        	}
 
         }
     }