camel-issues mailing list archives

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

    [ https://issues.apache.org/jira/browse/CAMEL-10418?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15615298#comment-15615298
] 

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
correctly.

I have modified it in this way:

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

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

See PR here:

https://github.com/apache/camel/compare/master...paoloantinori:CAMEL-10418?expand=1

> Deploy route with an error
> --------------------------
>
>                 Key: CAMEL-10418
>                 URL: https://issues.apache.org/jira/browse/CAMEL-10418
>             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
(v6.3.4#6332)

Mime
View raw message