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

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

commit b91aede031841dbf3cba5d0da71dfac9ebb7a854
Author: Otavio Rodolfo Piske <[email protected]>
AuthorDate: Mon Jan 15 11:05:55 2024 +0100

    CAMEL-20297 camel-optaplanner: do not swallow interrupted exceptions
---
 .../org/apache/camel/component/optaplanner/OptaPlannerProducer.java | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerProducer.java
 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerProducer.java
index da858737867..580a622272e 100644
--- 
a/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerProducer.java
+++ 
b/components/camel-optaplanner/src/main/java/org/apache/camel/component/optaplanner/OptaPlannerProducer.java
@@ -86,6 +86,9 @@ public class OptaPlannerProducer extends DefaultAsyncProducer 
{
 
                         // wait for result
                         populateResult(exchange, solverJob);
+                    } catch (InterruptedException e) {
+                        Thread.currentThread().interrupt();
+                        exchange.setException(e);
                     } catch (Exception e) {
                         exchange.setException(e);
                     } finally {
@@ -103,6 +106,9 @@ public class OptaPlannerProducer extends 
DefaultAsyncProducer {
             // synchronous or wrong type of body
             callback.done(true);
             return true;
+        } catch (InterruptedException e) {
+            Thread.currentThread().interrupt();
+            exchange.setException(e);
         } catch (Exception e) {
             exchange.setException(e);
         }

Reply via email to