camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Atanas Shindov <atanas.shin...@gmail.com>
Subject Route removal triggers endpoint shutdown
Date Thu, 26 Mar 2015 07:40:32 GMT
Hello,

I have a custom singleton endpoint which manages a resource used by all
consumers created by this endpoint. I open and close the resource in the
start() and stop() methods of the endpoint assuming that this way I would
prevent illegal states, i.e. the resource is closed, but a consumer is still
active and tries to read it.

However, I found out that Camel shutdowns an endpoint when a route is
removed which reads from the endpoint. This is a problem when there are more
than one routes reading from this endpoint as it results in the following
sequence:

[routes 1 & 2 are consuming from endpoint X]
1. route 1 is removed
- producer 1 is stopped.
- consumer 1 is stopped.
*2. endpoint X is stopped.*
3. route 2 is still active and consumer 2 tires to access the closed
resource.

A comment above the
ServiceHelper.stopAndShutdownServices(route.getEndpoint()) invocation inside
the org.apache.camel.impl.RouteService.doShutdown() method where the
shutdown happens says:

"// endpoints should only be stopped when Camel is shutting down
// see more details in the warmUp method"

However, this is not the case. Is this a bug or I'm missing something?



--
View this message in context: http://camel.465427.n5.nabble.com/Route-removal-triggers-endpoint-shutdown-tp5764796.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message