Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-15061

Performance issues with classMap.computeIfAbsent() in DefaultFactoryFinder

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.25.2, 3.4.0
    • camel-core, karaf
    • None
    • Unknown

    Description

      When Camel routes start, there are unnecessary calls from class DefaultFactoryFinder in method

         protected Class<?> addToClassMap(String key, ClassSupplier mappingFunction) throws ClassNotFoundException, IOException  {
              try {
                  return classMap.computeIfAbsent(key, (String classKey) -> { ...
      

      In a Karaf environment with the Java security manager enabled, this causes a massive delay in starting Camel routes, since there are thousands of calls into org.apache.felix.framework.BundleImpl.getEntry(), which is then authorised by the Java Security Manager. Its seems a bulk of these calls could be avoided if the call to classMap.computeIfAbsent() dealt with null values as well.

      Attachments

        Activity

          People

            ggrzybek Grzegorz Grzybek
            ggrzybek Grzegorz Grzybek
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: