camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Paolo Antinori (JIRA)" <>
Subject [jira] [Commented] (CAMEL-10418) Deploy route with an error
Date Fri, 28 Oct 2016 12:52:58 GMT


Paolo Antinori commented on CAMEL-10418:

Hi, I think that your test shows a real problem but the fix is not in the correct place.

In my opinion the real issue here is that {{org.apache.camel.impl.DefaultCamelContext#removeRouteDefinition(org.apache.camel.model.RouteDefinition)}}
, that is already correctly called even in your test, but it is not removing the route definition

I have modified it in this way:

     public synchronized void removeRouteDefinition(RouteDefinition routeDefinition) throws
Exception {
+        RouteDefinition toBeRemoved = routeDefinition;
         String id = routeDefinition.getId();
         if (id != null) {
             // remove existing route
+            toBeRemoved = getRouteDefinition(id);
-        this.routeDefinitions.remove(routeDefinition);
+        this.routeDefinitions.remove(toBeRemoved);

And now all test pass, included the new one you have added.

See PR here:

> Deploy route with an error
> --------------------------
>                 Key: CAMEL-10418
>                 URL:
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>            Reporter: Fabrizio Spataro
>            Assignee: Fabrizio Spataro
>            Priority: Minor
> When i create a route with an sintax error, it cannot be started but remains into camelcontext.
> An example to replicate it:
> 1. Deploy a route with an know id at runtime (using route definition). The route will
be invalid (with an sintax error)
> 2. Redeploy correct route with same id
> Camel throw an example because i cannot deploy a route with same id!!!

This message was sent by Atlassian JIRA

View raw message