You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ac...@apache.org on 2024/06/18 09:07:09 UTC
(camel) 11/17: CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - AWS Redshift
This is an automated email from the ASF dual-hosted git repository.
acosentino pushed a commit to branch CAMEL-20798-AWS-complete
in repository https://gitbox.apache.org/repos/asf/camel.git
commit abb92b50b7645cb2fa8d791ea91197407e9b4102
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Tue Jun 18 10:36:59 2024 +0200
CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - AWS Redshift
Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
.../aws2/redshift/data/RedshiftData2Endpoint.java | 20 +++++++++++++++++++-
1 file changed, 19 insertions(+), 1 deletion(-)
diff --git a/components/camel-aws/camel-aws2-redshift/src/main/java/org/apache/camel/component/aws2/redshift/data/RedshiftData2Endpoint.java b/components/camel-aws/camel-aws2-redshift/src/main/java/org/apache/camel/component/aws2/redshift/data/RedshiftData2Endpoint.java
index 3652ca76a2f..fde580783b8 100644
--- a/components/camel-aws/camel-aws2-redshift/src/main/java/org/apache/camel/component/aws2/redshift/data/RedshiftData2Endpoint.java
+++ b/components/camel-aws/camel-aws2-redshift/src/main/java/org/apache/camel/component/aws2/redshift/data/RedshiftData2Endpoint.java
@@ -22,6 +22,7 @@ import org.apache.camel.Consumer;
import org.apache.camel.Processor;
import org.apache.camel.Producer;
import org.apache.camel.component.aws2.redshift.data.client.RedshiftData2ClientFactory;
+import org.apache.camel.spi.EndpointServiceLocation;
import org.apache.camel.spi.UriEndpoint;
import org.apache.camel.spi.UriParam;
import org.apache.camel.support.DefaultEndpoint;
@@ -37,7 +38,7 @@ import software.amazon.awssdk.services.redshiftdata.RedshiftDataClient;
Category.CLOUD, Category.SERVERLESS,
Category.DATABASE, Category.BIGDATA },
headersClass = RedshiftData2Constants.class)
-public class RedshiftData2Endpoint extends DefaultEndpoint {
+public class RedshiftData2Endpoint extends DefaultEndpoint implements EndpointServiceLocation {
private RedshiftDataClient awsRedshiftDataClient;
@@ -91,4 +92,21 @@ public class RedshiftData2Endpoint extends DefaultEndpoint {
return awsRedshiftDataClient;
}
+ @Override
+ public String getServiceUrl() {
+ if (!configuration.isOverrideEndpoint()) {
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ return configuration.getRegion();
+ }
+ } else if (ObjectHelper.isNotEmpty(configuration.getUriEndpointOverride())) {
+ return configuration.getUriEndpointOverride();
+ }
+ return null;
+ }
+
+ @Override
+ public String getServiceProtocol() {
+ return "redshift";
+ }
+
}