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
The following commit(s) were added to refs/heads/main by this push:
new 5a30f6467fe CAMEL-18131 - camel-health - Add health checks for
components that has extension for connectivity verification - Fix check for
region before looking for enabled services - S3
5a30f6467fe is described below
commit 5a30f6467feda13546687c45ea2eb2e9256813dc
Author: Andrea Cosentino <[email protected]>
AuthorDate: Thu Oct 27 14:10:49 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 - S3
Signed-off-by: Andrea Cosentino <[email protected]>
---
.../camel/component/aws2/s3/AWS2S3ConsumerHealthCheck.java | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git
a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3ConsumerHealthCheck.java
b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3ConsumerHealthCheck.java
index 34f0ff65e96..8440edf94e5 100644
---
a/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3ConsumerHealthCheck.java
+++
b/components/camel-aws/camel-aws2-s3/src/main/java/org/apache/camel/component/aws2/s3/AWS2S3ConsumerHealthCheck.java
@@ -51,10 +51,12 @@ public class AWS2S3ConsumerHealthCheck extends
AbstractHealthCheck {
try {
AWS2S3Configuration configuration =
aws2S3Consumer.getConfiguration();
- if
(!S3Client.serviceMetadata().regions().contains(Region.of(configuration.getRegion())))
{
- builder.message("The service is not supported in this region");
- builder.down();
- return;
+ if (ObjectHelper.isNotEmpty(configuration.getRegion())) {
+ if
(!S3Client.serviceMetadata().regions().contains(Region.of(configuration.getRegion())))
{
+ builder.message("The service is not supported in this
region");
+ builder.down();
+ return;
+ }
}
S3Client client;
if (!configuration.isUseDefaultCredentialsProvider()) {