You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by GitBox <gi...@apache.org> on 2021/11/04 14:01:17 UTC

[GitHub] [camel-quarkus] aldettinger opened a new issue #3265: camel.main.routes-include-pattern with a "*" wildcard may end up loading a route builder twice

aldettinger opened a new issue #3265:
URL: https://github.com/apache/camel-quarkus/issues/3265


   When a camel-quarkus application is using `camel.main.routes-include-pattern` with a `*` wildcard, some 
    routebuilders/routeconfigurations resources might be loaded twice. Users may face error messages like below:
   - `Failed to start route xyz because of Multiple consumers for the same endpoint is not allowed`
   - `Route configuration already exists with id: xyz`
   
   The simplest way to reproduce might be to amend the [main-yaml/src/main/resources/applications.properties](https://github.com/apache/camel-quarkus/blob/main/integration-tests/main-yaml/src/main/resources/application.properties) file with `camel.main.routes-include-pattern = classpath:routes/*.yaml`
   Then, running the tests will show that route loading fails because of multiple consumers on a given endpoint. It might be due to the fact that a route is loaded twice.
   
   The `DefaultPackageScanResourceResolver` seems guilty as a `DefaultPackageScanResourceResolver.findInClasspath("routes/", resources, "*.yaml")` returns a collection of 4 routes while 2 are expected. It looks like the same underlying resource loaded from different class loaders are not equal. As such, the given resource can be returned twice in the `Set<Resource>`.
   
   Not sure yet whether we could consider the issue to be in camel or camel-quarkus.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] aldettinger commented on issue #3265: camel.main.routes-include-pattern with a "*" wildcard may end up loading a route builder twice

Posted by GitBox <gi...@apache.org>.
aldettinger commented on issue #3265:
URL: https://github.com/apache/camel-quarkus/issues/3265#issuecomment-1078899642


   Great to see that @jamesnetherton. Many thanks for handling it.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton commented on issue #3265: camel.main.routes-include-pattern with a "*" wildcard may end up loading a route builder twice

Posted by GitBox <gi...@apache.org>.
jamesnetherton commented on issue #3265:
URL: https://github.com/apache/camel-quarkus/issues/3265#issuecomment-1049791231


   This is only an issue when the application is under test where multiple Quarkus class loaders are in play:
   
   * Quarkus base runtime class loader
   * Quarkus runtime class loader
   
   At runtime there is just the `RunnerClassLoader`.
   
   Maybe there should be an `else` clause added here to add the `BasePackageScanResolver` `ClassLoader` only if the TCCL was `null`:
   
   https://github.com/apache/camel/blob/main/core/camel-base-engine/src/main/java/org/apache/camel/impl/engine/BasePackageScanResolver.java#L44
   
   That way you avoid adding multiple `ClassLoader` instances.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [camel-quarkus] jamesnetherton closed issue #3265: camel.main.routes-include-pattern with a "*" wildcard may end up loading a route builder twice

Posted by GitBox <gi...@apache.org>.
jamesnetherton closed issue #3265:
URL: https://github.com/apache/camel-quarkus/issues/3265


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@camel.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org