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 55f75fd2a67d917bbbe529a7ae69d9310d5bd6e3 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 28 07:01:48 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. --- .../camel/component/zookeeper/ZooKeeperConfiguration.java | 1 - .../camel/component/zookeeper/ZooKeeperEndpoint.java | 14 +++++++++++++- 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java index 56f2cd726bb..9922d564f78 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperConfiguration.java @@ -127,7 +127,6 @@ public class ZooKeeperConfiguration implements Cloneable { } b.setLength(b.length() - 1); return b.toString(); - } /** diff --git a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java index cd34caeb36d..4c50e67b21d 100644 --- a/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java +++ b/components/camel-zookeeper/src/main/java/org/apache/camel/component/zookeeper/ZooKeeperEndpoint.java @@ -25,6 +25,7 @@ import org.apache.camel.Producer; import org.apache.camel.api.management.ManagedAttribute; import org.apache.camel.api.management.ManagedOperation; import org.apache.camel.api.management.ManagedResource; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; import org.apache.camel.support.DefaultEndpoint; @@ -35,7 +36,8 @@ import org.apache.camel.support.DefaultEndpoint; @ManagedResource(description = "ZooKeeper Endpoint") @UriEndpoint(firstVersion = "2.9.0", scheme = "zookeeper", title = "ZooKeeper", syntax = "zookeeper:serverUrls/path", category = { Category.CLUSTERING, Category.MANAGEMENT, Category.BIGDATA }, headersClass = ZooKeeperMessage.class) -public class ZooKeeperEndpoint extends DefaultEndpoint { +public class ZooKeeperEndpoint extends DefaultEndpoint implements EndpointServiceLocation { + @UriParam private ZooKeeperConfiguration configuration; private ZooKeeperConnectionManager connectionManager; @@ -46,6 +48,16 @@ public class ZooKeeperEndpoint extends DefaultEndpoint { this.connectionManager = new ZooKeeperConnectionManager(this); } + @Override + public String getServiceUrl() { + return configuration.getConnectString(); + } + + @Override + public String getServiceProtocol() { + return "zookeeper"; + } + @Override public Producer createProducer() throws Exception { return new ZooKeeperProducer(this);