choice and predicate are used to do conditional routing based on attributes of an exchange/message, not static attibutes resolved on route startup...
I'm not following what you are trying to do...why would a Processor be NULL exactly? If a code change is required to add/remove/implement a processor, then you can modify your route along with that change. Otherwise, just create a simple processor that can handle the logic of checking the "state" of a processor before routing to it (using ProducerTemplate, etc) enalposi wrote: > > 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! > ----- Ben O'Day IT Consultant -http://consulting-notes.com -- View this message in context: http://camel.465427.n5.nabble.com/RouteBuilder-Predicate-Syntax-tp4590722p4600131.html Sent from the Camel - Users mailing list archive at Nabble.com.