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/14 09:43:31 UTC

(camel) branch CAMEL-20798-aws-ecs created (now d7165d51cc7)

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

acosentino pushed a change to branch CAMEL-20798-aws-ecs
in repository https://gitbox.apache.org/repos/asf/camel.git


      at d7165d51cc7 CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - AWS ECS

This branch includes the following new commits:

     new d7165d51cc7 CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - AWS ECS

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



(camel) 01/01: CAMEL-20798: EndpointServiceLocation on components to make it possible to know which remote system Camel connects to to assist for monitoring and observability - AWS ECS

Posted by ac...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

acosentino pushed a commit to branch CAMEL-20798-aws-ecs
in repository https://gitbox.apache.org/repos/asf/camel.git

commit d7165d51cc7cd2790183cb5fe6f3feb6d2799a15
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Fri Jun 14 11:43:15 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 ECS
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel/component/aws2/ecs/ECS2Endpoint.java       | 20 +++++++++++++++++++-
 1 file changed, 19 insertions(+), 1 deletion(-)

diff --git a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
index aae45b7d69e..4d685b6b4a6 100644
--- a/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.java
+++ b/components/camel-aws/camel-aws2-ecs/src/main/java/org/apache/camel/component/aws2/ecs/ECS2Endpoint.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.ecs.client.ECS2ClientFactory;
+import org.apache.camel.spi.EndpointServiceLocation;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.ScheduledPollEndpoint;
@@ -34,7 +35,7 @@ import software.amazon.awssdk.services.ecs.EcsClient;
 @UriEndpoint(firstVersion = "3.1.0", scheme = "aws2-ecs", title = "AWS Elastic Container Service (ECS)",
              syntax = "aws2-ecs:label", producerOnly = true, category = { Category.CLOUD, Category.MANAGEMENT },
              headersClass = ECS2Constants.class)
-public class ECS2Endpoint extends ScheduledPollEndpoint {
+public class ECS2Endpoint extends ScheduledPollEndpoint implements EndpointServiceLocation {
 
     private EcsClient ecsClient;
 
@@ -86,4 +87,21 @@ public class ECS2Endpoint extends ScheduledPollEndpoint {
     public EcsClient getEcsClient() {
         return ecsClient;
     }
+
+    @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 "ecs";
+    }
 }