You can use .noAutoStartup() on the RouteDefinition to indicate to not startup, and its a fluent builder so you can use it in the DSL.
On Tue, Jul 12, 2011 at 3:08 PM, lunchbox <lunchbox4s...@gmail.com> wrote: > Hi all, > > I have a route definition like so > > RouteDefinition myRoute = (RouteDefinition) > from(...).routeId(MY_ROUTE) > .transacted() > ...; > > myRoute.setAutoStartup("false"); > > I'd like to NOT have this route automatically start -- and there is > RouteDefinition.setAutoStartup for that. However, adding that transacted() > makes the chained method call actually an instance of PolicyDefinition. This > will cause a ClassCastException when I try to cast it to RouteDefinition. > > What's the deal with this? > > I'm defining the route in the RouteBuilder.configure method. Also, trying > getContext().getRouteDefinition(MY_ROUTE) at the end of the method will not > help since at this point it will always return null. > > What can I do to have the route transactional and not auto-started? > > Thanks, > Lunchbox > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/RouteDefinition-setAutoStartup-PolicyDefinition-ClassCastException-tp4578805p4578805.html > Sent from the Camel - Users mailing list archive at Nabble.com. > -- Claus Ibsen ----------------- FuseSource Email: cib...@fusesource.com Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.blogspot.com/ Author of Camel in Action: http://www.manning.com/ibsen/