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 2022/10/27 12:10:04 UTC

[camel] 01/03: CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - Fix check for region before looking for enabled services - Athena

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

acosentino pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 06e242f10d8d24da113fa01c633703c5f925b86a
Author: Andrea Cosentino <an...@gmail.com>
AuthorDate: Thu Oct 27 13:16:10 2022 +0200

    CAMEL-18131 - camel-health - Add health checks for components that has extension for connectivity verification - Fix check for region before looking for enabled services - Athena
    
    Signed-off-by: Andrea Cosentino <an...@gmail.com>
---
 .../camel/component/aws2/athena/Athena2ClientHealthCheck.java  | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java
index 2c3402d4b28..c8b70b02c8f 100644
--- a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java
@@ -50,10 +50,12 @@ public class Athena2ClientHealthCheck extends AbstractHealthCheck {
     protected void doCall(HealthCheckResultBuilder builder, Map<String, Object> options) {
 
         try {
-            if (!AthenaClient.serviceMetadata().regions().contains(Region.of(athena2Endpoint.getConfiguration().getRegion()))) {
-                builder.message("The service is not supported in this region");
-                builder.down();
-                return;
+            if (ObjectHelper.isNotEmpty(athena2Endpoint.getConfiguration().getRegion())) {
+                if (!AthenaClient.serviceMetadata().regions().contains(Region.of(athena2Endpoint.getConfiguration().getRegion()))) {
+                    builder.message("The service is not supported in this region");
+                    builder.down();
+                    return;
+                }
             }
             AthenaClient client;
             if (!athena2Endpoint.getConfiguration().isUseDefaultCredentialsProvider()) {