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/09/20 07:59:37 UTC

[camel] branch main updated (cfcc1c89fca -> 7e3f81e1099)

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

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


    from cfcc1c89fca camel-jbang - Upgrade to latest quarkus
     new 6fd89024f20 CAMEL-18131 - Adding health check to test conectivity
     new 38807619aed Fixing the health check to using default credentials provider or passing a custom client instance
     new 7e3f81e1099 Fixing the health check to using default credentials provider or passing a custom client instance

The 3 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.


Summary of changes:
 components/camel-aws/camel-aws2-athena/pom.xml     | 21 +++++
 .../health-check/camel-aws2-athena-repository      |  2 +
 .../aws2/athena/Athena2ClientHealthCheck.java      | 85 +++++++++++++++++++
 .../component/aws2/athena/Athena2Component.java    |  1 -
 .../athena/Athena2ComponentVerifierExtension.java  | 91 --------------------
 .../component/aws2/athena/Athena2Endpoint.java     | 17 ++++
 .../aws2/athena/Athena2HealthCheckRepository.java  | 87 +++++++++++++++++++
 .../Athena2ClientHealthCheckCustomClientTest.java  | 98 ++++++++++++++++++++++
 .../Athena2ClientHealthCheckProfileCredsTest.java  | 97 +++++++++++++++++++++
 .../Athena2ClientHealthCheckStaticCredsTest.java   | 97 +++++++++++++++++++++
 .../AthenaComponentVerifierExtensionTest.java      | 93 --------------------
 11 files changed, 504 insertions(+), 185 deletions(-)
 create mode 100644 components/camel-aws/camel-aws2-athena/src/generated/resources/META-INF/services/org/apache/camel/health-check/camel-aws2-athena-repository
 create mode 100644 components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java
 delete mode 100644 components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ComponentVerifierExtension.java
 create mode 100644 components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2HealthCheckRepository.java
 create mode 100644 components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
 create mode 100644 components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckProfileCredsTest.java
 create mode 100644 components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
 delete mode 100644 components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/AthenaComponentVerifierExtensionTest.java


[camel] 03/03: Fixing the health check to using default credentials provider or passing a custom client instance

Posted by ac...@apache.org.
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 7e3f81e1099e2b7ad3984388702e4528a747ca6f
Author: Rhuan Rocha <rh...@gmail.com>
AuthorDate: Mon Sep 19 16:11:27 2022 -0300

    Fixing the health check to using default credentials provider or passing a custom client instance
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
---
 .../camel/component/aws2/athena/Athena2ClientHealthCheck.java     | 8 +++-----
 .../aws2/athena/Athena2ClientHealthCheckCustomClientTest.java     | 6 +++---
 .../aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java      | 6 +++---
 3 files changed, 9 insertions(+), 11 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 24390c939bc..5da9df7a9c7 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
@@ -56,17 +56,15 @@ public class Athena2ClientHealthCheck extends AbstractHealthCheck {
                 return;
             }
             AthenaClient client;
-            if(!athena2Endpoint.getConfiguration().isUseDefaultCredentialsProvider()){
+            if (!athena2Endpoint.getConfiguration().isUseDefaultCredentialsProvider()) {
                 AwsBasicCredentials cred = AwsBasicCredentials.create(athena2Endpoint.getConfiguration().getAccessKey(),
                         athena2Endpoint.getConfiguration().getSecretKey());
                 AthenaClientBuilder clientBuilder = AthenaClient.builder();
                 client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
                         .region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
-            }
-            else if(ObjectHelper.isNotEmpty(athena2Endpoint.getConfiguration().getAmazonAthenaClient())){
+            } else if (ObjectHelper.isNotEmpty(athena2Endpoint.getConfiguration().getAmazonAthenaClient())) {
                 client = athena2Endpoint.getConfiguration().getAmazonAthenaClient();
-            }
-            else{
+            } else {
                 AthenaClientBuilder clientBuilder = AthenaClient.builder();
                 client = clientBuilder.region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
             }
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
index de65e4a9bb5..0728087ffd5 100644
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
@@ -17,6 +17,9 @@
 
 package org.apache.camel.component.aws2.athena;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -29,9 +32,6 @@ import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 public class Athena2ClientHealthCheckCustomClientTest extends CamelTestSupport {
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
index 81746543e84..a6cb710d55b 100644
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
@@ -17,6 +17,9 @@
 
 package org.apache.camel.component.aws2.athena;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -29,9 +32,6 @@ import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
 public class Athena2ClientHealthCheckStaticCredsTest extends CamelTestSupport {


[camel] 02/03: Fixing the health check to using default credentials provider or passing a custom client instance

Posted by ac...@apache.org.
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 38807619aed345f41c8126b2bd6655b1b4f3c8f3
Author: Rhuan Rocha <rh...@gmail.com>
AuthorDate: Mon Sep 19 15:59:08 2022 -0300

    Fixing the health check to using default credentials provider or passing a custom client instance
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
---
 .../aws2/athena/Athena2ClientHealthCheck.java       | 21 ++++++++++++++++-----
 ...> Athena2ClientHealthCheckCustomClientTest.java} | 15 ++++++++-------
 ...> Athena2ClientHealthCheckProfileCredsTest.java} |  6 +++---
 ...=> Athena2ClientHealthCheckStaticCredsTest.java} | 12 ++++++------
 4 files changed, 33 insertions(+), 21 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 e80214f3379..24390c939bc 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
@@ -21,6 +21,7 @@ import java.util.Map;
 
 import org.apache.camel.health.HealthCheckResultBuilder;
 import org.apache.camel.impl.health.AbstractHealthCheck;
+import org.apache.camel.util.ObjectHelper;
 import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
 import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
 import software.amazon.awssdk.awscore.exception.AwsServiceException;
@@ -54,11 +55,21 @@ public class Athena2ClientHealthCheck extends AbstractHealthCheck {
                 builder.down();
                 return;
             }
-            AwsBasicCredentials cred = AwsBasicCredentials.create(athena2Endpoint.getConfiguration().getAccessKey(),
-                    athena2Endpoint.getConfiguration().getSecretKey());
-            AthenaClientBuilder clientBuilder = AthenaClient.builder();
-            AthenaClient client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
-                    .region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
+            AthenaClient client;
+            if(!athena2Endpoint.getConfiguration().isUseDefaultCredentialsProvider()){
+                AwsBasicCredentials cred = AwsBasicCredentials.create(athena2Endpoint.getConfiguration().getAccessKey(),
+                        athena2Endpoint.getConfiguration().getSecretKey());
+                AthenaClientBuilder clientBuilder = AthenaClient.builder();
+                client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
+                        .region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
+            }
+            else if(ObjectHelper.isNotEmpty(athena2Endpoint.getConfiguration().getAmazonAthenaClient())){
+                client = athena2Endpoint.getConfiguration().getAmazonAthenaClient();
+            }
+            else{
+                AthenaClientBuilder clientBuilder = AthenaClient.builder();
+                client = clientBuilder.region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
+            }
             client.listQueryExecutions();
         } catch (AwsServiceException e) {
             builder.message(e.getMessage());
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
similarity index 91%
copy from components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
copy to components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
index 915edf9bf90..de65e4a9bb5 100644
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckCustomClientTest.java
@@ -17,9 +17,6 @@
 
 package org.apache.camel.component.aws2.athena;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -32,11 +29,14 @@ import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
-public class Athena2ClientHealthCheckTest extends CamelTestSupport {
+public class Athena2ClientHealthCheckCustomClientTest extends CamelTestSupport {
 
-    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckCustomClientTest.class);
 
     CamelContext context;
 
@@ -44,7 +44,8 @@ public class Athena2ClientHealthCheckTest extends CamelTestSupport {
     protected CamelContext createCamelContext() throws Exception {
         context = super.createCamelContext();
         context.getPropertiesComponent().setLocation("ref:prop");
-
+        AmazonAthenaClientMock clientMock = new AmazonAthenaClientMock();
+        context.getRegistry().bind("amazonAthenaClient", clientMock);
         // install health check manually (yes a bit cumbersome)
         HealthCheckRegistry registry = new DefaultHealthCheckRegistry();
         registry.setCamelContext(context);
@@ -66,7 +67,7 @@ public class Athena2ClientHealthCheckTest extends CamelTestSupport {
             @Override
             public void configure() {
                 from("direct:getQueryExecution")
-                        .to("aws2-athena://label?accessKey=xxx&secretKey=yyy&region=l");
+                        .to("aws2-athena://label?region=l");
             }
         };
     }
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckProfileCredsTest.java
similarity index 94%
copy from components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
copy to components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckProfileCredsTest.java
index 915edf9bf90..63b7a825398 100644
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckProfileCredsTest.java
@@ -34,9 +34,9 @@ import org.slf4j.LoggerFactory;
 
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
-public class Athena2ClientHealthCheckTest extends CamelTestSupport {
+public class Athena2ClientHealthCheckProfileCredsTest extends CamelTestSupport {
 
-    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckProfileCredsTest.class);
 
     CamelContext context;
 
@@ -66,7 +66,7 @@ public class Athena2ClientHealthCheckTest extends CamelTestSupport {
             @Override
             public void configure() {
                 from("direct:getQueryExecution")
-                        .to("aws2-athena://label?accessKey=xxx&secretKey=yyy&region=l");
+                        .to("aws2-athena://label?region=l&useDefaultCredentialsProvider=true");
             }
         };
     }
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
similarity index 94%
rename from components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
rename to components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
index 915edf9bf90..81746543e84 100644
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckStaticCredsTest.java
@@ -17,9 +17,6 @@
 
 package org.apache.camel.component.aws2.athena;
 
-import java.util.Collection;
-import java.util.concurrent.TimeUnit;
-
 import org.apache.camel.CamelContext;
 import org.apache.camel.builder.RouteBuilder;
 import org.apache.camel.health.HealthCheck;
@@ -32,11 +29,14 @@ import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
 import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
 
-public class Athena2ClientHealthCheckTest extends CamelTestSupport {
+public class Athena2ClientHealthCheckStaticCredsTest extends CamelTestSupport {
 
-    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckTest.class);
+    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckStaticCredsTest.class);
 
     CamelContext context;
 
@@ -66,7 +66,7 @@ public class Athena2ClientHealthCheckTest extends CamelTestSupport {
             @Override
             public void configure() {
                 from("direct:getQueryExecution")
-                        .to("aws2-athena://label?accessKey=xxx&secretKey=yyy&region=l");
+                        .to("aws2-athena://label?region=l&secretKey=l&accessKey=k");
             }
         };
     }


[camel] 01/03: CAMEL-18131 - Adding health check to test conectivity

Posted by ac...@apache.org.
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 6fd89024f20796755c879a69431522d1c1c66b49
Author: Rhuan Rocha <rh...@gmail.com>
AuthorDate: Sun Aug 21 18:32:04 2022 -0300

    CAMEL-18131 - Adding health check to test conectivity
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
    
    CAMEL-18131 - Adding health check to test conectivity
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
    
    CAMEL-18131 - Adding health check to test conectivity
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
    
    CAMEL-18131 - Adding health check to test conectivity
    
    Signed-off-by: Rhuan Rocha <rh...@gmail.com>
---
 components/camel-aws/camel-aws2-athena/pom.xml     | 21 +++++
 .../health-check/camel-aws2-athena-repository      |  2 +
 .../aws2/athena/Athena2ClientHealthCheck.java      | 76 +++++++++++++++++
 .../component/aws2/athena/Athena2Component.java    |  1 -
 .../athena/Athena2ComponentVerifierExtension.java  | 91 --------------------
 .../component/aws2/athena/Athena2Endpoint.java     | 17 ++++
 .../aws2/athena/Athena2HealthCheckRepository.java  | 87 +++++++++++++++++++
 .../aws2/athena/Athena2ClientHealthCheckTest.java  | 97 ++++++++++++++++++++++
 .../AthenaComponentVerifierExtensionTest.java      | 93 ---------------------
 9 files changed, 300 insertions(+), 185 deletions(-)

diff --git a/components/camel-aws/camel-aws2-athena/pom.xml b/components/camel-aws/camel-aws2-athena/pom.xml
index a3d8a495392..1890cb0b936 100644
--- a/components/camel-aws/camel-aws2-athena/pom.xml
+++ b/components/camel-aws/camel-aws2-athena/pom.xml
@@ -51,6 +51,11 @@
             <version>${aws-java-sdk2-version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-health</artifactId>
+        </dependency>
+
         <!-- for testing -->
         <dependency>
             <groupId>org.apache.camel</groupId>
@@ -72,5 +77,21 @@
             <artifactId>mockito-junit-jupiter</artifactId>
             <scope>test</scope>
         </dependency>
+
+        <!-- test infra -->
+        <dependency>
+            <groupId>org.apache.camel</groupId>
+            <artifactId>camel-test-infra-aws-v2</artifactId>
+            <version>${project.version}</version>
+            <type>test-jar</type>
+            <scope>test</scope>
+        </dependency>
+
+        <dependency>
+            <groupId>org.awaitility</groupId>
+            <artifactId>awaitility</artifactId>
+            <scope>test</scope>
+        </dependency>
+
     </dependencies>
 </project>
diff --git a/components/camel-aws/camel-aws2-athena/src/generated/resources/META-INF/services/org/apache/camel/health-check/camel-aws2-athena-repository b/components/camel-aws/camel-aws2-athena/src/generated/resources/META-INF/services/org/apache/camel/health-check/camel-aws2-athena-repository
new file mode 100644
index 00000000000..4a65fadb0b7
--- /dev/null
+++ b/components/camel-aws/camel-aws2-athena/src/generated/resources/META-INF/services/org/apache/camel/health-check/camel-aws2-athena-repository
@@ -0,0 +1,2 @@
+# Generated by camel build tools - do NOT edit this file!
+class=org.apache.camel.component.aws2.athena.Athena2HealthCheckRepository
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
new file mode 100644
index 00000000000..e80214f3379
--- /dev/null
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheck.java
@@ -0,0 +1,76 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.aws2.athena;
+
+import java.util.Map;
+
+import org.apache.camel.health.HealthCheckResultBuilder;
+import org.apache.camel.impl.health.AbstractHealthCheck;
+import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
+import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
+import software.amazon.awssdk.awscore.exception.AwsServiceException;
+import software.amazon.awssdk.regions.Region;
+import software.amazon.awssdk.services.athena.AthenaClient;
+import software.amazon.awssdk.services.athena.AthenaClientBuilder;
+
+public class Athena2ClientHealthCheck extends AbstractHealthCheck {
+
+    private final Athena2Endpoint athena2Endpoint;
+    private final String clientId;
+
+    public Athena2ClientHealthCheck(Athena2Endpoint athena2Endpoint, String clientId) {
+        super("camel", "aws2-athena-client-" + clientId);
+        this.athena2Endpoint = athena2Endpoint;
+        this.clientId = clientId;
+    }
+
+    @Override
+    public boolean isLiveness() {
+        // this health check is only readiness
+        return false;
+    }
+
+    @Override
+    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;
+            }
+            AwsBasicCredentials cred = AwsBasicCredentials.create(athena2Endpoint.getConfiguration().getAccessKey(),
+                    athena2Endpoint.getConfiguration().getSecretKey());
+            AthenaClientBuilder clientBuilder = AthenaClient.builder();
+            AthenaClient client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
+                    .region(Region.of(athena2Endpoint.getConfiguration().getRegion())).build();
+            client.listQueryExecutions();
+        } catch (AwsServiceException e) {
+            builder.message(e.getMessage());
+            builder.error(e);
+            builder.down();
+            return;
+
+        } catch (Exception e) {
+            builder.error(e);
+            builder.down();
+            return;
+        }
+        builder.up();
+    }
+}
diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Component.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Component.java
index 8d5b9f3ecc4..f2ebe27a207 100644
--- a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Component.java
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Component.java
@@ -43,7 +43,6 @@ public class Athena2Component extends DefaultComponent {
 
     public Athena2Component(CamelContext context) {
         super(context);
-        registerExtension(new Athena2ComponentVerifierExtension());
     }
 
     @Override
diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ComponentVerifierExtension.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ComponentVerifierExtension.java
deleted file mode 100644
index e3c1dff9f0f..00000000000
--- a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2ComponentVerifierExtension.java
+++ /dev/null
@@ -1,91 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.aws2.athena;
-
-import java.util.Map;
-
-import org.apache.camel.component.extension.verifier.DefaultComponentVerifierExtension;
-import org.apache.camel.component.extension.verifier.ResultBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorBuilder;
-import org.apache.camel.component.extension.verifier.ResultErrorHelper;
-import software.amazon.awssdk.auth.credentials.AwsBasicCredentials;
-import software.amazon.awssdk.auth.credentials.StaticCredentialsProvider;
-import software.amazon.awssdk.awscore.exception.AwsServiceException;
-import software.amazon.awssdk.regions.Region;
-import software.amazon.awssdk.services.athena.AthenaClient;
-import software.amazon.awssdk.services.athena.AthenaClientBuilder;
-
-public class Athena2ComponentVerifierExtension extends DefaultComponentVerifierExtension {
-
-    public Athena2ComponentVerifierExtension() {
-        this("aws2-athena");
-    }
-
-    public Athena2ComponentVerifierExtension(String scheme) {
-        super(scheme);
-    }
-
-    // *********************************
-    // Parameters validation
-    // *********************************
-
-    @Override
-    protected Result verifyParameters(Map<String, Object> parameters) {
-        ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.PARAMETERS)
-                .error(ResultErrorHelper.requiresOption("accessKey", parameters))
-                .error(ResultErrorHelper.requiresOption("secretKey", parameters))
-                .error(ResultErrorHelper.requiresOption("region", parameters));
-
-        // Validate using the catalog
-        super.verifyParametersAgainstCatalog(builder, parameters);
-
-        return builder.build();
-    }
-
-    // *********************************
-    // Connectivity validation
-    // *********************************
-
-    @Override
-    protected Result verifyConnectivity(Map<String, Object> parameters) {
-        ResultBuilder builder = ResultBuilder.withStatusAndScope(Result.Status.OK, Scope.CONNECTIVITY);
-        try {
-            Athena2Configuration configuration = setProperties(new Athena2Configuration(), parameters);
-            if (!AthenaClient.serviceMetadata().regions().contains(Region.of(configuration.getRegion()))) {
-                ResultErrorBuilder errorBuilder = ResultErrorBuilder.withCodeAndDescription(
-                        VerificationError.StandardCode.ILLEGAL_PARAMETER, "The service is not supported in this region");
-                return builder.error(errorBuilder.build()).build();
-            }
-            AwsBasicCredentials cred = AwsBasicCredentials.create(configuration.getAccessKey(), configuration.getSecretKey());
-            AthenaClientBuilder clientBuilder = AthenaClient.builder();
-            AthenaClient client = clientBuilder.credentialsProvider(StaticCredentialsProvider.create(cred))
-                    .region(Region.of(configuration.getRegion())).build();
-            client.listQueryExecutions();
-        } catch (AwsServiceException e) {
-            ResultErrorBuilder errorBuilder
-                    = ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION, e.getMessage())
-                            .detail("aws_athena_exception_message", e.getMessage())
-                            .detail(VerificationError.ExceptionAttribute.EXCEPTION_CLASS, e.getClass().getName())
-                            .detail(VerificationError.ExceptionAttribute.EXCEPTION_INSTANCE, e);
-
-            builder.error(errorBuilder.build());
-        } catch (Exception e) {
-            builder.error(ResultErrorBuilder.withException(e).build());
-        }
-        return builder.build();
-    }
-}
diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Endpoint.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Endpoint.java
index 797fb3404ba..9799e0300a0 100644
--- a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Endpoint.java
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2Endpoint.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.athena.client.Athena2ClientFactory;
+import org.apache.camel.health.HealthCheckHelper;
 import org.apache.camel.spi.UriEndpoint;
 import org.apache.camel.spi.UriParam;
 import org.apache.camel.support.DefaultEndpoint;
@@ -37,6 +38,9 @@ public class Athena2Endpoint extends DefaultEndpoint {
 
     private AthenaClient athenaClient;
 
+    private Athena2HealthCheckRepository healthCheckRepository;
+    private Athena2ClientHealthCheck clientHealthCheck;
+
     @UriParam
     private Athena2Configuration configuration;
 
@@ -62,10 +66,23 @@ public class Athena2Endpoint extends DefaultEndpoint {
         athenaClient = configuration.getAmazonAthenaClient() != null
                 ? configuration.getAmazonAthenaClient()
                 : Athena2ClientFactory.getAWSAthenaClient(configuration).getAthenaClient();
+
+        healthCheckRepository = HealthCheckHelper.getHealthCheckRepository(getCamelContext(),
+                Athena2HealthCheckRepository.REPOSITORY_ID, Athena2HealthCheckRepository.class);
+
+        if (healthCheckRepository != null) {
+            clientHealthCheck = new Athena2ClientHealthCheck(this, getId());
+            healthCheckRepository.addHealthCheck(clientHealthCheck);
+        }
     }
 
     @Override
     public void doStop() throws Exception {
+        if (healthCheckRepository != null && clientHealthCheck != null) {
+            healthCheckRepository.removeHealthCheck(clientHealthCheck);
+            clientHealthCheck = null;
+        }
+
         if (ObjectHelper.isEmpty(configuration.getAmazonAthenaClient())) {
             if (athenaClient != null) {
                 athenaClient.close();
diff --git a/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2HealthCheckRepository.java b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2HealthCheckRepository.java
new file mode 100644
index 00000000000..090671edbab
--- /dev/null
+++ b/components/camel-aws/camel-aws2-athena/src/main/java/org/apache/camel/component/aws2/athena/Athena2HealthCheckRepository.java
@@ -0,0 +1,87 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.aws2.athena;
+
+import java.util.List;
+import java.util.concurrent.CopyOnWriteArrayList;
+import java.util.stream.Stream;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.CamelContextAware;
+import org.apache.camel.DeferredContextBinding;
+import org.apache.camel.NonManagedService;
+import org.apache.camel.StaticService;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckRepository;
+import org.apache.camel.support.service.ServiceSupport;
+
+/**
+ * Repository for camel-aws2-athena {@link HealthCheck}s.
+ */
+@org.apache.camel.spi.annotations.HealthCheck("camel-aws2-athena-repository")
+@DeferredContextBinding
+public class Athena2HealthCheckRepository extends ServiceSupport
+        implements CamelContextAware, HealthCheckRepository, StaticService, NonManagedService {
+
+    public static final String REPOSITORY_ID = "camel-aws2-athena";
+
+    private final List<HealthCheck> checks = new CopyOnWriteArrayList<>();
+    private volatile CamelContext context;
+    private boolean enabled = true;
+
+    @Override
+    public void setCamelContext(CamelContext camelContext) {
+        this.context = camelContext;
+    }
+
+    @Override
+    public String getId() {
+        return REPOSITORY_ID;
+    }
+
+    @Override
+    public CamelContext getCamelContext() {
+        return context;
+    }
+
+    @Override
+    public boolean isEnabled() {
+        return enabled;
+    }
+
+    @Override
+    public void setEnabled(boolean enabled) {
+        this.enabled = enabled;
+    }
+
+    @Override
+    public Stream<HealthCheck> stream() {
+        return this.context != null && enabled
+                ? checks.stream()
+                : Stream.empty();
+    }
+
+    public void addHealthCheck(HealthCheck healthCheck) {
+        CamelContextAware.trySetCamelContext(healthCheck, getCamelContext());
+        this.checks.add(healthCheck);
+    }
+
+    public void removeHealthCheck(HealthCheck healthCheck) {
+        this.checks.remove(healthCheck);
+    }
+}
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
new file mode 100644
index 00000000000..915edf9bf90
--- /dev/null
+++ b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/Athena2ClientHealthCheckTest.java
@@ -0,0 +1,97 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements.  See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License.  You may obtain a copy of the License at
+ *
+ *      http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.camel.component.aws2.athena;
+
+import java.util.Collection;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.camel.CamelContext;
+import org.apache.camel.builder.RouteBuilder;
+import org.apache.camel.health.HealthCheck;
+import org.apache.camel.health.HealthCheckHelper;
+import org.apache.camel.health.HealthCheckRegistry;
+import org.apache.camel.impl.health.DefaultHealthCheckRegistry;
+import org.apache.camel.test.junit5.CamelTestSupport;
+import org.junit.jupiter.api.Assertions;
+import org.junit.jupiter.api.Test;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import static org.testcontainers.shaded.org.awaitility.Awaitility.await;
+
+public class Athena2ClientHealthCheckTest extends CamelTestSupport {
+
+    private static final Logger LOG = LoggerFactory.getLogger(Athena2ClientHealthCheckTest.class);
+
+    CamelContext context;
+
+    @Override
+    protected CamelContext createCamelContext() throws Exception {
+        context = super.createCamelContext();
+        context.getPropertiesComponent().setLocation("ref:prop");
+
+        // install health check manually (yes a bit cumbersome)
+        HealthCheckRegistry registry = new DefaultHealthCheckRegistry();
+        registry.setCamelContext(context);
+        Object hc = registry.resolveById("context");
+        registry.register(hc);
+        hc = registry.resolveById("routes");
+        registry.register(hc);
+        hc = registry.resolveById("consumers");
+        registry.register(hc);
+        context.setExtension(HealthCheckRegistry.class, registry);
+
+        return context;
+    }
+
+    @Override
+    protected RouteBuilder createRouteBuilder() {
+        return new RouteBuilder() {
+
+            @Override
+            public void configure() {
+                from("direct:getQueryExecution")
+                        .to("aws2-athena://label?accessKey=xxx&secretKey=yyy&region=l");
+            }
+        };
+    }
+
+    @Test
+    public void testConnectivity() {
+
+        Collection<HealthCheck.Result> res = HealthCheckHelper.invokeLiveness(context);
+        boolean up = res.stream().allMatch(r -> r.getState().equals(HealthCheck.State.UP));
+        Assertions.assertTrue(up, "liveness check");
+
+        // health-check readiness should be down
+        await().atMost(20, TimeUnit.SECONDS).untilAsserted(() -> {
+            Collection<HealthCheck.Result> res2 = HealthCheckHelper.invokeReadiness(context);
+            boolean down = res2.stream().allMatch(r -> r.getState().equals(HealthCheck.State.DOWN));
+            boolean containsAws2AthenaHealthCheck = res2.stream()
+                    .filter(result -> result.getCheck().getId().startsWith("aws2-athena-client"))
+                    .findAny()
+                    .isPresent();
+            boolean hasRegionMessage = res2.stream()
+                    .anyMatch(r -> r.getMessage().stream().anyMatch(msg -> msg.contains("region")));
+            Assertions.assertTrue(down, "liveness check");
+            Assertions.assertTrue(containsAws2AthenaHealthCheck, "aws2-athena check");
+            Assertions.assertTrue(hasRegionMessage, "aws2-athena check error message");
+        });
+
+    }
+}
diff --git a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/AthenaComponentVerifierExtensionTest.java b/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/AthenaComponentVerifierExtensionTest.java
deleted file mode 100644
index f4fb47d16aa..00000000000
--- a/components/camel-aws/camel-aws2-athena/src/test/java/org/apache/camel/component/aws2/athena/AthenaComponentVerifierExtensionTest.java
+++ /dev/null
@@ -1,93 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements.  See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License.  You may obtain a copy of the License at
- *
- *      http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-package org.apache.camel.component.aws2.athena;
-
-import java.util.HashMap;
-import java.util.Map;
-
-import org.apache.camel.Component;
-import org.apache.camel.component.extension.ComponentVerifierExtension;
-import org.apache.camel.test.junit5.CamelTestSupport;
-import org.junit.jupiter.api.Test;
-
-import static org.junit.jupiter.api.Assertions.assertEquals;
-
-public class AthenaComponentVerifierExtensionTest extends CamelTestSupport {
-
-    // *************************************************
-    // Tests (parameters)
-    // *************************************************
-    @Override
-    public boolean isUseRouteBuilder() {
-        return false;
-    }
-
-    @Test
-    public void testParameters() {
-        Component component = context().getComponent("aws2-athena");
-
-        ComponentVerifierExtension verifier
-                = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
-
-        Map<String, Object> parameters = new HashMap<>();
-        parameters.put("secretKey", "l");
-        parameters.put("accessKey", "k");
-        parameters.put("region", "l");
-        parameters.put("label", "l");
-        parameters.put("operation", "startQueryExecution");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.PARAMETERS, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.OK, result.getStatus());
-    }
-
-    @Test
-    public void testConnectivity() {
-        Component component = context().getComponent("aws2-athena");
-        ComponentVerifierExtension verifier
-                = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
-
-        Map<String, Object> parameters = new HashMap<>();
-        parameters.put("secretKey", "l");
-        parameters.put("accessKey", "k");
-        parameters.put("region", "US_EAST_1");
-        parameters.put("label", "l");
-        parameters.put("operation", "startQueryExecution");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
-    }
-
-    @Test
-    public void testConnectivityAndRegion() {
-        Component component = context().getComponent("aws2-athena");
-        ComponentVerifierExtension verifier
-                = component.getExtension(ComponentVerifierExtension.class).orElseThrow(IllegalStateException::new);
-
-        Map<String, Object> parameters = new HashMap<>();
-        parameters.put("secretKey", "l");
-        parameters.put("accessKey", "k");
-        parameters.put("region", "l");
-        parameters.put("label", "l");
-        parameters.put("operation", "startQueryExecution");
-
-        ComponentVerifierExtension.Result result = verifier.verify(ComponentVerifierExtension.Scope.CONNECTIVITY, parameters);
-
-        assertEquals(ComponentVerifierExtension.Result.Status.ERROR, result.getStatus());
-    }
-}