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

davsclaus pushed a commit to branch camel-4.10.x
in repository https://gitbox.apache.org/repos/asf/camel.git


The following commit(s) were added to refs/heads/camel-4.10.x by this push:
     new f72114d10fc CAMEL-19731 Implemented try-with-resources for MinioClient 
(#17364)
f72114d10fc is described below

commit f72114d10fc9987767e42b7d57b7972c1db20e4c
Author: Dmitry Kryukov <d...@users.noreply.github.com>
AuthorDate: Thu Mar 6 09:34:26 2025 +0300

    CAMEL-19731 Implemented try-with-resources for MinioClient (#17364)
---
 .../camel/component/minio/MinioComponentVerifierExtension.java       | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git 
a/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioComponentVerifierExtension.java
 
b/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioComponentVerifierExtension.java
index 4b0117f89f9..db44bc9da7c 100644
--- 
a/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioComponentVerifierExtension.java
+++ 
b/components/camel-minio/src/main/java/org/apache/camel/component/minio/MinioComponentVerifierExtension.java
@@ -89,8 +89,9 @@ public class MinioComponentVerifierExtension extends 
DefaultComponentVerifierExt
                 clientBuilderRequest.credentials(configuration.getAccessKey(), 
configuration.getSecretKey());
             }
 
-            MinioClient client = clientBuilderRequest.build();
-            client.listBuckets();
+            try (MinioClient client = clientBuilderRequest.build()) {
+                client.listBuckets();
+            }
         } catch (MinioException e) {
             ResultErrorBuilder errorBuilder
                     = 
ResultErrorBuilder.withCodeAndDescription(VerificationError.StandardCode.AUTHENTICATION,
 e.getMessage())

Reply via email to