camel-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ningji...@apache.org
Subject [1/4] camel git commit: CAMEL-8816 Fixed the elasticsearch component start up issue when using the local elasticsearch instance
Date Fri, 29 May 2015 15:06:52 GMT
Repository: camel
Updated Branches:
  refs/heads/camel-2.14.x f0443ae89 -> 920429bd7
  refs/heads/camel-2.15.x 7dfb61aa8 -> b2188887a


CAMEL-8816 Fixed the elasticsearch component start up issue when using the local elasticsearch
instance

Conflicts:
	components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java


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

Branch: refs/heads/camel-2.15.x
Commit: c17f8c95ab25cd0f025bfb80b5beadd9649fa62c
Parents: 7dfb61a
Author: Willem Jiang <willem.jiang@gmail.com>
Authored: Fri May 29 11:15:18 2015 +0800
Committer: Willem Jiang <willem.jiang@gmail.com>
Committed: Fri May 29 22:34:54 2015 +0800

----------------------------------------------------------------------
 .../component/elasticsearch/ElasticsearchEndpoint.java    | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/camel/blob/c17f8c95/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
----------------------------------------------------------------------
diff --git a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
index da49c12..eb83171 100644
--- a/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
+++ b/components/camel-elasticsearch/src/main/java/org/apache/camel/component/elasticsearch/ElasticsearchEndpoint.java
@@ -31,9 +31,12 @@ import org.elasticsearch.common.settings.ImmutableSettings;
 import org.elasticsearch.common.settings.Settings;
 import org.elasticsearch.common.transport.InetSocketTransportAddress;
 import org.elasticsearch.node.Node;
+import org.elasticsearch.node.NodeBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
+
 /**
  * Represents an Elasticsearch endpoint.
  */
@@ -89,7 +92,12 @@ public class ElasticsearchEndpoint extends DefaultEndpoint {
                     .addTransportAddress(new InetSocketTransportAddress(configuration.getIp(),
configuration.getPort()));
             this.client = client;
         } else {
-            node = configuration.buildNode();
+            NodeBuilder builder = nodeBuilder().local(configuration.isLocal()).data(configuration.isData());
+            if (!configuration.isLocal() && configuration.getClusterName() != null)
{
+                builder.clusterName(configuration.getClusterName());
+            }
+            builder.getSettings().classLoader(Settings.class.getClassLoader());
+            node = builder.node();
             client = node.client();
         }
     }


Mime
View raw message