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 38a7e5c3dbd9b846cba51c361ea7efcaccca2f91 Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Tue May 28 07:40:33 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/olingo2/Olingo2Endpoint.java | 13 ++++++++++++- .../org/apache/camel/component/olingo4/Olingo4Endpoint.java | 13 ++++++++++++- 2 files changed, 24 insertions(+), 2 deletions(-) diff --git a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Endpoint.java b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Endpoint.java index a3241a0669d..6f0319d6d2b 100644 --- a/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Endpoint.java +++ b/components/camel-olingo2/camel-olingo2-component/src/main/java/org/apache/camel/component/olingo2/Olingo2Endpoint.java @@ -30,6 +30,7 @@ import org.apache.camel.component.olingo2.internal.Olingo2ApiCollection; import org.apache.camel.component.olingo2.internal.Olingo2ApiName; import org.apache.camel.component.olingo2.internal.Olingo2Constants; import org.apache.camel.component.olingo2.internal.Olingo2PropertiesHelper; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; import org.apache.camel.spi.PropertyConfigurer; import org.apache.camel.spi.UriEndpoint; @@ -47,7 +48,7 @@ import org.apache.camel.util.CaseInsensitiveMap; @UriEndpoint(firstVersion = "2.14.0", scheme = "olingo2", title = "Olingo2", syntax = "olingo2:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.CLOUD }, headersClass = Olingo2Constants.class) -public class Olingo2Endpoint extends AbstractApiEndpoint<Olingo2ApiName, Olingo2Configuration> { +public class Olingo2Endpoint extends AbstractApiEndpoint<Olingo2ApiName, Olingo2Configuration> implements EndpointServiceLocation { protected static final String RESOURCE_PATH_PROPERTY = "resourcePath"; protected static final String RESPONSE_HANDLER_PROPERTY = "responseHandler"; @@ -80,6 +81,16 @@ public class Olingo2Endpoint extends AbstractApiEndpoint<Olingo2ApiName, Olingo2 this.configuration = endpointConfiguration; } + @Override + public String getServiceUrl() { + return configuration.getServiceUri(); + } + + @Override + public String getServiceProtocol() { + return "odata"; + } + @Override public Producer createProducer() throws Exception { return new Olingo2Producer(this); diff --git a/components/camel-olingo4/camel-olingo4-component/src/main/java/org/apache/camel/component/olingo4/Olingo4Endpoint.java b/components/camel-olingo4/camel-olingo4-component/src/main/java/org/apache/camel/component/olingo4/Olingo4Endpoint.java index 10a41d682dd..24a5bcafdca 100644 --- a/components/camel-olingo4/camel-olingo4-component/src/main/java/org/apache/camel/component/olingo4/Olingo4Endpoint.java +++ b/components/camel-olingo4/camel-olingo4-component/src/main/java/org/apache/camel/component/olingo4/Olingo4Endpoint.java @@ -30,6 +30,7 @@ import org.apache.camel.component.olingo4.internal.Olingo4ApiCollection; import org.apache.camel.component.olingo4.internal.Olingo4ApiName; import org.apache.camel.component.olingo4.internal.Olingo4Constants; import org.apache.camel.component.olingo4.internal.Olingo4PropertiesHelper; +import org.apache.camel.spi.EndpointServiceLocation; import org.apache.camel.spi.ExtendedPropertyConfigurerGetter; import org.apache.camel.spi.PropertyConfigurer; import org.apache.camel.spi.UriEndpoint; @@ -47,7 +48,7 @@ import org.apache.camel.util.CaseInsensitiveMap; @UriEndpoint(firstVersion = "2.19.0", scheme = "olingo4", title = "Olingo4", syntax = "olingo4:apiName/methodName", apiSyntax = "apiName/methodName", category = { Category.CLOUD }, headersClass = Olingo4Constants.class) -public class Olingo4Endpoint extends AbstractApiEndpoint<Olingo4ApiName, Olingo4Configuration> { +public class Olingo4Endpoint extends AbstractApiEndpoint<Olingo4ApiName, Olingo4Configuration> implements EndpointServiceLocation { protected static final String RESOURCE_PATH_PROPERTY = "resourcePath"; protected static final String RESPONSE_HANDLER_PROPERTY = "responseHandler"; @@ -80,6 +81,16 @@ public class Olingo4Endpoint extends AbstractApiEndpoint<Olingo4ApiName, Olingo4 this.configuration = endpointConfiguration; } + @Override + public String getServiceUrl() { + return configuration.getServiceUri(); + } + + @Override + public String getServiceProtocol() { + return "odata"; + } + @Override public Producer createProducer() throws Exception { return new Olingo4Producer(this);