[
https://issues.apache.org/jira/browse/CAMEL-11321?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16024502#comment-16024502
]
Claus Ibsen commented on CAMEL-11321:
-------------------------------------
Btw the classpath scanning is only scanning in one known location
META-INF/service/org/apache/camel/component/ and then looking for a file with
the same name as the component you are using.
However if the classpath has 60+ jars then the system have to traverse all
those JARs until it finds it.
The same for type converters which is loaded in a similar way.
We would need to do some profiling how expensive that is. And a maven plugin
alike spring-boot re-package can be created that build a camel-index.properties
file or something and place that in the root folder in target/classes or
target/classes/META-INF/service or somewhere and then camel-core is able to
detect and load that, and then don't need to do traverse the classpath anymore.
In the old days the type converts was slower due we did a full classpath
scanning, eg the fast track is that if you know the absolute name of the file
to load, then that is much faster, than just known the package name, and then
need to scan inside those packages.
> Can CamelContext startup faster
> -------------------------------
>
> Key: CAMEL-11321
> URL: https://issues.apache.org/jira/browse/CAMEL-11321
> Project: Camel
> Issue Type: Improvement
> Components: camel-core, camel-spring-boot
> Reporter: Claus Ibsen
> Fix For: Future
>
>
> [~lb] have some thoughts on if we can make CamelContext startup faster,
> especially when using Spring Boot. Spring Boot itself is not so fast, but
> should be faster in 2.x.
> For example we could consider camel-core to not do any classpath scanning for
> components that are provided OOTB in camel-core, eg if using "log" endpoint,
> then only check the spring registry if any custom bean of that, and if not,
> then we know "log" is from camel-core and then we know its class name already
> and dont need to scan the classpath.
> We could take that one step further for the entire Camel release and have a
> plugin that generate/keep java source file up to date from camel-core, which
> has complete mapping of all component-name=component-class.
> We can also do some profiling and see if there is some hot-spots. There is
> also the revised work that Zoran does in starting Camel on spring /
> spring-boot.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)