camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [2/2] camel git commit: CAMEL-8156 SNSClient should setup endpoint before creating the topic
Date Wed, 17 Dec 2014 05:01:40 GMT
CAMEL-8156  SNSClient should setup endpoint before creating the topic


Project: http://git-wip-us.apache.org/repos/asf/camel/repo
Commit: http://git-wip-us.apache.org/repos/asf/camel/commit/81379a6b
Tree: http://git-wip-us.apache.org/repos/asf/camel/tree/81379a6b
Diff: http://git-wip-us.apache.org/repos/asf/camel/diff/81379a6b

Branch: refs/heads/camel-2.13.x
Commit: 81379a6b930ea14be3d33cdbd8e84498344b7cae
Parents: 5e3a5ba
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Wed Dec 17 12:58:47 2014 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Wed Dec 17 13:01:05 2014 +0800

----------------------------------------------------------------------
 .../apache/camel/component/aws/sns/SnsEndpoint.java    | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/81379a6b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sns/SnsEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sns/SnsEndpoint.java
b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sns/SnsEndpoint.java
index 031d112..8f51821 100644
--- a/components/camel-aws/src/main/java/org/apache/camel/component/aws/sns/SnsEndpoint.java
+++ b/components/camel-aws/src/main/java/org/apache/camel/component/aws/sns/SnsEndpoint.java
@@ -72,6 +72,13 @@ public class SnsEndpoint extends DefaultEndpoint {
         super.doStart();
         snsClient = configuration.getAmazonSNSClient() != null
             ? configuration.getAmazonSNSClient() : createSNSClient();
+        
+        // Override the setting Endpoint from url
+        if (ObjectHelper.isNotEmpty(configuration.getAmazonSNSEndpoint())) {
+            LOG.trace("Updating the SNS region with : {} " + configuration.getAmazonSNSEndpoint());
+            snsClient.setEndpoint(configuration.getAmazonSNSEndpoint());
+        }
+        
         // creates a new topic, or returns the URL of an existing one
         CreateTopicRequest request = new CreateTopicRequest(configuration.getTopicName());
         
@@ -89,11 +96,7 @@ public class SnsEndpoint extends DefaultEndpoint {
             
             LOG.trace("Topic policy updated");
         }
-        // Override the setting Endpoint from url
-        if (ObjectHelper.isNotEmpty(configuration.getAmazonSNSEndpoint())) {
-            LOG.trace("Updating the SNS region with : {} " + configuration.getAmazonSNSEndpoint());
-            snsClient.setEndpoint(configuration.getAmazonSNSEndpoint());
-        }
+        
     }
 
     public SnsConfiguration getConfiguration() {


Mime
View raw message