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


The following commit(s) were added to refs/heads/master by this push:
     new bde9f1a  Camel-AWS2-SNS: Check if useDefaultCredentialsProvider is 
present or not
bde9f1a is described below

commit bde9f1a9becbffaae1ab5f1507ab63963cd634be
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Apr 7 17:58:40 2021 +0200

    Camel-AWS2-SNS: Check if useDefaultCredentialsProvider is present or not
---
 .../main/java/org/apache/camel/component/aws2/sns/Sns2Component.java    | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git 
a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Component.java
 
b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Component.java
index 5f3694c..9bb0696 100644
--- 
a/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Component.java
+++ 
b/components/camel-aws/camel-aws2-sns/src/main/java/org/apache/camel/component/aws2/sns/Sns2Component.java
@@ -72,7 +72,7 @@ public class Sns2Component extends DefaultComponent {
             LOG.debug("Created the endpoint with topic {}", 
configuration.getTopicName());
         }
 
-        if (configuration.getAmazonSNSClient() == null
+        if (!configuration.isUseDefaultCredentialsProvider() && 
configuration.getAmazonSNSClient() == null
                 && (configuration.getAccessKey() == null || 
configuration.getSecretKey() == null)) {
             throw new IllegalArgumentException("AmazonSNSClient or accessKey 
and secretKey must be specified");
         }

Reply via email to