camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Hadrian Zbarcea <>
Subject Re: programatically rewire routes
Date Wed, 22 Apr 2009 13:24:07 GMT
Hi Peter,

Imho not easily, because there is no way today to identify/address a  
node in the AST.  I can think of two things that may work.

One is to sorta artificially split the route in two using a direct  

and later on stop the routes and replace the second one with

The second option is to use a DelegateProcessor in the middle of the  
route that delegates to a noop processor which you can later replace  
with a processor of your choice.

In the first case you'd need to know with some approximation where you  
want to insert your processor, in the second case you need to know  
exactly where it should be injected.  There's nothing better I can  
think of now, if anybody has a better idea, please shout.

I hope this helps,

On Apr 22, 2009, at 8:52 AM, Peter Maas wrote:

> Hi,
> is it possible the programmatically replace parts of a route (for  
> testing purposes) to temporarily add processor in the middle of the  
> route for example? One case I (think) I need it for is for testing  
> unexpected errors, I'd like to mimic this by 'injecting' a processor  
> which throws a unchecked exception; the ErrorHandlerTest does do  
> this but only with custom routes...
> any ideas?
> Peter

View raw message