camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <willem.ji...@gmail.com>
Subject Re: Dynamically removing routes
Date Sat, 15 May 2010 00:26:00 GMT
Hi,

I just committed a quick fix for CAMEL-2722, now if you don't want to 
use route any more , you can use CamelContext.shutdownRoute(routeId) to 
shutdown the route, Camel will remove the ManagedRoute from the MBServer 
for you.

Willem

Willem Jiang wrote:
> Hi,
> 
> I just check the code of DefaultManagementLifecycleStrategy[1], the 
> managedRoute is not unregister itself when the onRoutesRemove() is called.
> 
> I guess it just want to avoid to do the duplicate work when the whole 
> CamelContext is shutdown. You can see that from the comments.
> 
> But for you case, we should let the ManagedRoute unregister itself.
> I just create a JIRA[2] for it.
> 
> [1]https://svn.apache.org/repos/asf/camel/trunk/camel-core/src/main/java/org/apache/camel/management/DefaultManagementLifecycleStrategy.java

> 
> [2]https://issues.apache.org/activemq/browse/CAMEL-2722
> 
> Willem
> 
> kumaap0 wrote:
>> Hi I'm running Camel 2.2.0 I've got my application running and im 
>> trying to
>> dynamically remove a route, i have exposed the below method via JMX
>>
>> public void removeRoute(String name) throws Exception {
>>         if (springCamelContext.getRouteDefinition(name) != null) {
>>             springCamelContext.stopRoute(name);
>>             logger.info("route "+name +"removed
>> "+springCamelContext.removeRouteDefinition(name));
>>         }
>>         else{
>>             logger.error("trying to remove route that doesn't exist");
>>         }
>> }
>>
>> The method looks like it worked the route has stopped and if i run this
>> method again with the same name
>> i get the logged error "trying to remove route that doesn't exist" 
>> which i
>> expect.
>>
>> But when i use JConsole i can still see my route and also i can click and
>> start it again. Is is normal ?
>>
>> Cheers
>> kumaap0
>>
>>
> 
> 


Mime
View raw message