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

Optimize AsyncCallback in EIPs to use reusable static classes

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 2.20.0
    • Component/s: camel-core
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When some EIPs or consumer routes via AsyncCallback then we create a new AsyncCallback as anonymous inner class. But this creates a new instance as the JVM cannot optimize that.

      As those callback don't usually have their own state, we can likely replace that with a single reusable instance which can reduce the memory allocation.

      For example this TimerConsumer$3 can be optimized.

        Attachments

          Activity

            People

            • Assignee:
              davsclaus Claus Ibsen
              Reporter:
              davsclaus Claus Ibsen
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: