Details
-
Improvement
-
Status: Closed
-
Minor
-
Resolution: Information Provided
-
None
-
None
-
None
-
Unknown
Description
There is no option to configure allowOptimisedComponents for toD EIP using Java DSL, it can only be configured in an XML route.
The only option available is to define a ToDynamicDefinition and add it to the route definition, for example:
public class TestRouteBuilder extends RouteBuilder { @Override public void configure() throws Exception { ToDynamicDefinition tdd = new ToDynamicDefinition("direct:${header.whereto}") .ignoreInvalidEndpoint() .pattern(ExchangePattern.InOut) .allowOptimisedComponents(true); RouteDefinition route = from("direct:start") .log(LoggingLevel.INFO, "This is a test"); route.addOutput(tdd); } }