LoadBalanceType does not wrap children processors

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

LoadBalanceType does not wrap children processors

William Tam
Hi camel-dev,

It looks like children processors of load balancer are not being
wrapped by interceptor strategy.  As a result, sendTo processors may
not be debuggable by Debugger or monitored by JMX.  Let me know if I
should log a JIRA.

Thanks,
William

Index: camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java
===================================================================
--- camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java (revision
706661)
+++ camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java (working
copy)
@@ -121,20 +121,20 @@
         }
         return loadBalancer;
     }
-
-    // when this method will be called
+
     @Override
     public Processor createProcessor(RouteContext routeContext)
throws Exception {
         LoadBalancer loadBalancer =
LoadBalancerType.getLoadBalancer(routeContext, loadBalancerType, ref);
         for (ProcessorType processorType : getOutputs()) {
             // The outputs should be the SendProcessor
-            SendProcessor processor = (SendProcessor)
processorType.createProcessor(routeContext);
-            loadBalancer.addProcessor(processor);
+            Processor processor = processorType.createProcessor(routeContext);
+            processor =
processorType.wrapProcessorInInterceptors(routeContext, processor);
+            loadBalancer.addProcessor((SendProcessor)processor);
         }

         return loadBalancer;
     }
-
+
Reply | Threaded
Open this post in threaded view
|

RE: LoadBalanceType does not wrap children processors

Claus Ibsen
Hi

Yes please do and attach the patch, then we have the fix logged in the public.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: William Tam [mailto:[hidden email]]
Sent: 21. oktober 2008 17:52
To: [hidden email]
Subject: LoadBalanceType does not wrap children processors

Hi camel-dev,

It looks like children processors of load balancer are not being
wrapped by interceptor strategy.  As a result, sendTo processors may
not be debuggable by Debugger or monitored by JMX.  Let me know if I
should log a JIRA.

Thanks,
William

Index: camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java
===================================================================
--- camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java (revision
706661)
+++ camel-core/src/main/java/org/apache/camel/model/LoadBalanceType.java (working
copy)
@@ -121,20 +121,20 @@
         }
         return loadBalancer;
     }
-
-    // when this method will be called
+
     @Override
     public Processor createProcessor(RouteContext routeContext)
throws Exception {
         LoadBalancer loadBalancer =
LoadBalancerType.getLoadBalancer(routeContext, loadBalancerType, ref);
         for (ProcessorType processorType : getOutputs()) {
             // The outputs should be the SendProcessor
-            SendProcessor processor = (SendProcessor)
processorType.createProcessor(routeContext);
-            loadBalancer.addProcessor(processor);
+            Processor processor = processorType.createProcessor(routeContext);
+            processor =
processorType.wrapProcessorInInterceptors(routeContext, processor);
+            loadBalancer.addProcessor((SendProcessor)processor);
         }

         return loadBalancer;
     }
-
+