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

Performance issues with classMap.computeIfAbsent() in DefaultFactoryFinder

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.25.2, 3.4.0
    • Component/s: camel-core, karaf
    • Labels:
      None
    • Estimated Complexity:
      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

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

              Dates

              • Created:
                Updated:
                Resolved: