Quantcast
Channel: Apache Timeline
Viewing all articles
Browse latest Browse all 5648

Removing a route after it is completed

$
0
0
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)

Viewing all articles
Browse latest Browse all 5648

Trending Articles