You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by ja...@apache.org on 2024/02/09 09:14:42 UTC

(camel) branch camel-3.22.x updated: CAMEL-20401: Check for potential null Kudu client on endpoint stop

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

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


The following commit(s) were added to refs/heads/camel-3.22.x by this push:
     new b80d0d5ce0e CAMEL-20401: Check for potential null Kudu client on endpoint stop
b80d0d5ce0e is described below

commit b80d0d5ce0ecef76768b59e07893fda1d83d69e7
Author: James Netherton <ja...@gmail.com>
AuthorDate: Fri Feb 9 08:55:03 2024 +0000

    CAMEL-20401: Check for potential null Kudu client on endpoint stop
---
 .../java/org/apache/camel/component/kudu/KuduEndpoint.java  | 13 ++++++++-----
 1 file changed, 8 insertions(+), 5 deletions(-)

diff --git a/components/camel-kudu/src/main/java/org/apache/camel/component/kudu/KuduEndpoint.java b/components/camel-kudu/src/main/java/org/apache/camel/component/kudu/KuduEndpoint.java
index afa11f9a9fd..80ad4a42ea7 100644
--- a/components/camel-kudu/src/main/java/org/apache/camel/component/kudu/KuduEndpoint.java
+++ b/components/camel-kudu/src/main/java/org/apache/camel/component/kudu/KuduEndpoint.java
@@ -85,11 +85,14 @@ public class KuduEndpoint extends DefaultEndpoint {
 
     @Override
     protected void doStop() throws Exception {
-        try {
-            LOG.info("doStop()");
-            getKuduClient().shutdown();
-        } catch (Exception e) {
-            LOG.error("Unable to shutdown kudu client", e);
+        KuduClient client = getKuduClient();
+        if (client != null) {
+            LOG.debug("Shutting down kudu client");
+            try {
+                client.shutdown();
+            } catch (Exception e) {
+                LOG.error("Unable to shutdown kudu client", e);
+            }
         }
 
         super.doStop();