You can stop and then remove the route, then Camel does a graceful shutdown of the route to complete all its inflight messages first.
On Sun, Jan 18, 2015 at 5:36 AM, aidatechinc <[email protected]> wrote: > I am trying to remove a route using camelContext.removeRoute(routeId) but I > only want to do it one the route is complete. I have the below snippet of > code, I attempted to use onCompletion, but no luck. > > > val camel = CamelExtension(system) > camel.context.addRoutes(new CustomRouteBuilder(system, producer)) > > class CustomRouteBuilder(system: ActorSystem, producerActor: ActorRef) > extends RouteBuilder { > > def configure { > from(route.source.uri).to(route.target.uri) > .routeId(route.source.id) > } > } > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Removing-a-route-after-it-is-completed-tp5761836.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- Red Hat, Inc. Email: [email protected] Twitter: davsclaus Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen hawtio: http://hawt.io/ fabric8: http://fabric8.io/
