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 5fbbeb1b76460a3274f5ee26312cc85da2e6865c
Author: Andrea Cosentino <[email protected]>
AuthorDate: Tue Jun 18 10:09:21 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 Kinesis Firehose
    
    Signed-off-by: Andrea Cosentino <[email protected]>
---
 .../aws2/firehose/KinesisFirehose2Endpoint.java    | 25 ++++++++++++++++++++++
 1 file changed, 25 insertions(+)

diff --git 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
index c0674983a40..2d250ac1f44 100644
--- 
a/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
+++ 
b/components/camel-aws/camel-aws2-kinesis/src/main/java/org/apache/camel/component/aws2/firehose/KinesisFirehose2Endpoint.java
@@ -28,6 +28,8 @@ import org.apache.camel.support.DefaultEndpoint;
 import org.apache.camel.util.ObjectHelper;
 import software.amazon.awssdk.services.firehose.FirehoseClient;
 
+import java.util.Map;
+
 import static software.amazon.awssdk.core.SdkSystemSetting.CBOR_ENABLED;
 
 /**
@@ -94,5 +96,28 @@ public class KinesisFirehose2Endpoint extends 
DefaultEndpoint implements Endpoin
         return configuration;
     }
 
+    @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 "firehose";
+    }
+
+    @Override
+    public Map<String, String> getServiceMetadata() {
+        if (configuration.getStreamName() != null) {
+            return Map.of("stream", configuration.getStreamName());
+        }
+        return null;
+    }
 }

Reply via email to