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 9efadf2  CAMEL-12236 - Camel-AWS SWF: Region is not set during client 
creation
9efadf2 is described below

commit 9efadf24fd501562ac8b910a7e05e1ad2170474e
Author: Andrea Cosentino <anco...@gmail.com>
AuthorDate: Wed Feb 7 11:01:17 2018 +0100

    CAMEL-12236 - Camel-AWS SWF: Region is not set during client creation
---
 .../main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
index 93a6a7a..238adfe 100644
--- 
a/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
+++ 
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/swf/SWFEndpoint.java
@@ -21,6 +21,7 @@ import com.amazonaws.auth.AWSCredentials;
 import com.amazonaws.auth.AWSCredentialsProvider;
 import com.amazonaws.auth.AWSStaticCredentialsProvider;
 import com.amazonaws.auth.BasicAWSCredentials;
+import com.amazonaws.regions.Regions;
 import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflow;
 import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClient;
 import com.amazonaws.services.simpleworkflow.AmazonSimpleWorkflowClientBuilder;
@@ -35,6 +36,7 @@ import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.util.EndpointHelper;
 import org.apache.camel.util.ExchangeHelper;
+import org.apache.camel.util.ObjectHelper;
 
 /**
  * The aws-swf component is used for managing workflows from Amazon Simple 
Workflow.
@@ -102,7 +104,11 @@ public class SWFEndpoint extends DefaultEndpoint {
             setProperties(clientConfiguration, 
configuration.getClientConfigurationParameters());
         }
 
-        AmazonSimpleWorkflow client = 
AmazonSimpleWorkflowClientBuilder.standard().withClientConfiguration(clientConfiguration).withCredentials(credentialsProvider).build();
+        AmazonSimpleWorkflowClientBuilder builder = 
AmazonSimpleWorkflowClientBuilder.standard().withClientConfiguration(clientConfiguration).withCredentials(credentialsProvider);
+        if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+            builder = 
builder.withRegion(Regions.valueOf(configuration.getRegion()));
+        }
+        AmazonSimpleWorkflow client = builder.build();
         if (!configuration.getSWClientParameters().isEmpty()) {
             setProperties(client, configuration.getSWClientParameters());
         }

-- 
To stop receiving notification emails like this one, please contact
acosent...@apache.org.

Reply via email to