You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2021/06/02 13:42:27 UTC
[camel] branch master updated: fixing Camel-16681 where
LazyStartProducer can result in Exceptions when used in multithreaded
context (#5620)
This is an automated email from the ASF dual-hosted git repository.
davsclaus pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/camel.git
The following commit(s) were added to refs/heads/master by this push:
new b10d6be fixing Camel-16681 where LazyStartProducer can result in Exceptions when used in multithreaded context (#5620)
b10d6be is described below
commit b10d6be0bcb232c76402b200046c95552d1c488a
Author: Samrat Dhillon <sa...@gmail.com>
AuthorDate: Wed Jun 2 09:42:00 2021 -0400
fixing Camel-16681 where LazyStartProducer can result in Exceptions when used in multithreaded context (#5620)
Co-authored-by: Samrat Dhillon <sa...@innovapost.com>
---
.../src/main/java/org/apache/camel/support/LazyStartProducer.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java b/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
index 0a94030..bdf8d670 100644
--- a/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
+++ b/core/camel-support/src/main/java/org/apache/camel/support/LazyStartProducer.java
@@ -44,11 +44,11 @@ public final class LazyStartProducer extends DefaultAsyncProducer implements Del
if (delegate == null) {
delegate = AsyncProcessorConverterHelper.convert(getEndpoint().createProducer());
}
+ if (!ServiceHelper.isStarted(delegate)) {
+ ServiceHelper.startService(delegate);
+ }
}
}
- if (!ServiceHelper.isStarted(delegate)) {
- ServiceHelper.startService(delegate);
- }
} catch (Throwable e) {
exchange.setException(e);
callback.done(true);