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 938422492fca115dfd60274aa3fdcfb910843827 Author: Otavio Rodolfo Piske <[email protected]> AuthorDate: Mon Jan 15 11:04:55 2024 +0100 CAMEL-20297 camel-jpa: do not swallow interrupted exceptions --- .../main/java/org/apache/camel/component/jpa/JpaPollingConsumer.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaPollingConsumer.java b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaPollingConsumer.java index 8489e16157e..0564411a47c 100644 --- a/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaPollingConsumer.java +++ b/components/camel-jpa/src/main/java/org/apache/camel/component/jpa/JpaPollingConsumer.java @@ -199,7 +199,10 @@ public class JpaPollingConsumer extends PollingConsumerSupport { Future<Exchange> future = executorService.submit((Callable<Exchange>) this::receive); try { return future.get(timeout, TimeUnit.MILLISECONDS); - } catch (ExecutionException | InterruptedException e) { + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + throw RuntimeCamelException.wrapRuntimeCamelException(e); + } catch (ExecutionException e) { throw RuntimeCamelException.wrapRuntimeCamelException(e); } catch (TimeoutException e) { // ignore as we hit timeout then return null
