Use the force luke ... just use java code, with a if branch

For that you need to break the dsl into the elements and build them together

ProcessorDefinition part = from("xxx").to("xxx");
if (foo) {
   part = part.wireTap("xxx")
}
// continue routing here
part.xxx



On Fri, Jul 31, 2015 at 2:30 PM, SteveR <srichard...@vonage.com> wrote:
> I also tried using the PredicateBuilder.constant() method to create a
> predicate that resolves to true/false, based on my Java configuration
> boolean:
>
> *    private static Boolean mirrorEnabled = null; // Set based on the
> "enabled" MIRROR configuration value.
>     Predicate mirrorWireTap = PredicateBuilder.constant(mirrorEnabled);*
>
>  and then added this DSL:
>
> *    .choice()
>          .when(mirrorWireTap).wireTap(mirrorToURI).id(sourceRouteId +
> "_MIRROR")
>     .end()*
>
> ... but dumping the roue as XML from within VisualVM shows that the choice()
> block encompasses the wireTap() and the remainder of the route.  I just want
> something that lets me conditionally run the wireTap() method, or not.
>
>   Thanks, Steve
>
>
>
>
>
> --
> View this message in context: 
> http://camel.465427.n5.nabble.com/Conditionally-omitting-a-portion-of-a-route-tp5770127p5770165.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
http://davsclaus.com @davsclaus
Camel in Action 2nd edition: http://www.manning.com/ibsen2

Reply via email to