Hi, 

I'm creating and tearing down temporary queues at runtime in my application. 
I'm getting an error I believe has been seen many times before by others:

Cannot publish to a deleted Destination: ... Cannot publish to a deleted
Destination: temp-queue://ID:...

I suspect it's because when I tear down RouteDefinitions own my own, then I
don't get the benefits of the new graceful shutdown feature.  

Essentially, I would like my queue to hang around until all messages have
been pulled from it, if all possible.  This would be better behavior for my
application, and I *think* stop this error from occuring.  (I'm not 100%
sure this temporary queue logic is the source of the error message, but it
did start showing up right after I added the feature into our application)

Roughly, this is what I'm currently doing:
// creating temporary routes
RouteBuilder builder = new RouteBuilde() { ...}

// save route definitions for teardown
RoutesDefinition routesDefinition = builder.getRouteCollection();

builder.addRoutesToCamelContext(camelContext)

... some time later ...

// destroy temporary routes
camel.removeRouteDefinitions(routesDefinitions.getRoutes());


Does that look right?  Is there something I can do better to destroy the
routes once all the messages have been processed?

Thanks!
Seth
-- 
View this message in context: 
http://old.nabble.com/Graceful-shutdown-and-individual-routes-tp27709462p27709462.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Reply via email to