A have a route similar to the below, whereby I also have a Java configuration
variable (e.g. *mirrorEnabled=true/false*) that tells me whether or not to
do the wiretap mirror. My question is; what is the best way to implement
the route filtering to skip the wireTap() portion of the route if
mirrorEnabled= false?
I'm hoping it's doable with the simple language, but haven't yet figured out
how to cleanly do it. The most brute-force way, would be to wrap two sets
of the below route in a Java if-else block, but that's just silly ;-)
Thanks, SteveR
from(fromURI)
.routeId(sourceRouteId)
.routePolicy(routePolicy)
.startupOrder(routeStartupOrder)
.setProperty(Exchange.CHARSET_NAME,
ExpressionBuilder.constantExpression(charsetName))
//
-----------------------------------------------------------
// This wiretap implements the mirror functionality.
// A traditional wiretap whereby Camel will copy the
original
// Exchange and set its Exchange Pattern to InOnly, as
we want
// the tapped Exchange to be sent in a fire and forget
style.
//
-----------------------------------------------------------
* .wireTap(mirrorToURI)
.id(sourceRouteId + "_MIRROR")*
// -----------------------------------------------------
// to(backupFileToURI, throughputFileToURI, sedaMainURI)
// -----------------------------------------------------
.to(firstToURIs)
.id(sourceRouteId + "_TO_FIRST_URIS");
--
View this message in context:
http://camel.465427.n5.nabble.com/Conditionally-omitting-a-portion-of-a-route-tp5770127.html
Sent from the Camel - Users mailing list archive at Nabble.com.