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 750b85f543a05e823850eb0e86691b6ac3a96512 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 28 07:07:39 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. --- .../org/apache/camel/component/vertx/VertxEndpoint.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/components/camel-vertx/camel-vertx/src/main/java/org/apache/camel/component/vertx/VertxEndpoint.java b/components/camel-vertx/camel-vertx/src/main/java/org/apache/camel/component/vertx/VertxEndpoint.java index 74007494e23..772d6862350 100644 --- a/components/camel-vertx/camel-vertx/src/main/java/org/apache/camel/component/vertx/VertxEndpoint.java +++ b/components/camel-vertx/camel-vertx/src/main/java/org/apache/camel/component/vertx/VertxEndpoint.java @@ -24,6 +24,7 @@ import org.apache.camel.Consumer; import org.apache.camel.MultipleConsumersSupport; import org.apache.camel.Processor; import org.apache.camel.Producer; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.Metadata; import org.apache.camel.spi.UriEndpoint; import org.apache.camel.spi.UriParam; @@ -35,7 +36,7 @@ import org.apache.camel.support.DefaultEndpoint; */ @UriEndpoint(firstVersion = "2.12.0", scheme = "vertx", title = "Vert.x", syntax = "vertx:address", category = { Category.MESSAGING }) -public class VertxEndpoint extends DefaultEndpoint implements AsyncEndpoint, MultipleConsumersSupport { +public class VertxEndpoint extends DefaultEndpoint implements AsyncEndpoint, MultipleConsumersSupport, EndpointServiceLocation { @UriPath @Metadata(required = true) @@ -53,6 +54,19 @@ public class VertxEndpoint extends DefaultEndpoint implements AsyncEndpoint, Mul return (VertxComponent) super.getComponent(); } + @Override + public String getServiceUrl() { + if (getComponent().getHost() != null) { + return getComponent().getHost() + ":" + getComponent().getPort(); + } + return null; + } + + @Override + public String getServiceProtocol() { + return "vertx"; + } + @Override public Producer createProducer() throws Exception { return new VertxProducer(this);