Ok, so I initially used #1 but it failed to build the route. The issue seems
to be different than what I originally assumed...

Basically I am building a route and want to insert a processor based upon a
condition (which is: does the processor exist?). Initially I did this with
an if-then-else statement but didn't like repeating most of the route
definition - so I tried choice().

The condition (processor exists) is known at route build time, so I
implemented a BooleanPredicate, which would return true if the related
processor is defined/injected or false if it is null. The choice would now
route through the processor if it was not null. However, apparently
RouteBuilder does not like the processor being null, even if it never routes
through it. This kind of makes sense, since choice is meant to work
dynamically on message content. So what I did instead now is remove the
choice() and just insert a DummyProcessor, if the worker processor is null.

Is this a reasonable way to address the issue or is there a better way?

Thanks!

--
View this message in context: 
http://camel.465427.n5.nabble.com/RouteBuilder-Predicate-Syntax-tp4590722p4599593.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to