This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch ra
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 6eddc0cb25b294a14e1edde3a5b0762cf105387a
Author: Claus Ibsen <claus.ib...@gmail.com>
AuthorDate: Sun May 26 10:34:50 2024 +0200

    CAMEL-20798: Add RemoteAddress to endpoints so they can tell the 
url/hostname etc for the system it connects. This is needed for better 
monitoring, tracing and management. Add this information into camel-tracer as 
tags.
---
 .../rest/client/ElasticsearchRestClientEndpoint.java              | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git 
a/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticsearchRestClientEndpoint.java
 
b/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticsearchRestClientEndpoint.java
index 06e0013b248..eb13e8e283d 100644
--- 
a/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticsearchRestClientEndpoint.java
+++ 
b/components/camel-elasticsearch-rest-client/src/main/java/org/apache/camel/component/elasticsearch/rest/client/ElasticsearchRestClientEndpoint.java
@@ -20,6 +20,7 @@ import org.apache.camel.Category;
 import org.apache.camel.Consumer;
 import org.apache.camel.Processor;
 import org.apache.camel.Producer;
+import org.apache.camel.spi.EndpointLocationAddress;
 import org.apache.camel.spi.Metadata;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
@@ -35,7 +36,7 @@ import org.elasticsearch.client.RestClient;
              title = "Elasticsearch Low level Rest Client",
              syntax = "elasticsearch-rest-client:clusterName", producerOnly = 
true,
              category = { Category.SEARCH })
-public class ElasticsearchRestClientEndpoint extends DefaultEndpoint {
+public class ElasticsearchRestClientEndpoint extends DefaultEndpoint 
implements EndpointLocationAddress {
 
     @UriPath
     @Metadata(required = true)
@@ -91,6 +92,11 @@ public class ElasticsearchRestClientEndpoint extends 
DefaultEndpoint {
         throw new UnsupportedOperationException("Cannot consume from an 
ElasticsearchEndpoint: " + getEndpointUri());
     }
 
+    @Override
+    public String getAddress() {
+        return getHostAddressesList();
+    }
+
     /**
      * Cluster Name
      */

Reply via email to