Author: davsclaus
Date: Fri Dec 16 14:35:18 2011
New Revision: 1215157
URL: http://svn.apache.org/viewvc?rev=1215157&view=rev
Log:
CAMEL-4787: Fixed issue with unit of work may re-wrap route context processor
at runtime, causing an ever growing processor path
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java
Modified:
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java
URL:
http://svn.apache.org/viewvc/camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java?rev=1215157&r1=1215156&r2=1215157&view=diff
==============================================================================
---
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java
(original)
+++
camel/trunk/camel-core/src/main/java/org/apache/camel/processor/UnitOfWorkProcessor.java
Fri Dec 16 14:35:18 2011
@@ -78,6 +78,17 @@ public class UnitOfWorkProcessor extends
}
@Override
+ protected void doStart() throws Exception {
+ // if a route context has been configured, then wrap the processor
with a
+ // RouteContextProcessor to ensure we track the route context properly
during
+ // processing of the exchange
+ if (routeContext != null) {
+ processor = new RouteContextProcessor(routeContext, processor);
+ }
+ super.doStart();
+ }
+
+ @Override
public boolean process(final Exchange exchange, final AsyncCallback
callback) {
// if the exchange doesn't have from route id set, then set it if it
originated
// from this unit of work
@@ -98,14 +109,6 @@ public class UnitOfWorkProcessor extends
return true;
}
-
- // if a route context has been configured, then wrap the processor
with a
- // RouteContextProcessor to ensure we track the route context
properly during
- // processing of the exchange
- if (routeContext != null) {
- processor = new RouteContextProcessor(routeContext, processor);
- }
-
Object synchronous =
exchange.removeProperty(Exchange.UNIT_OF_WORK_PROCESS_SYNC);
if (synchronous != null) {
// the exchange signalled to process synchronously