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

Optimize AsyncCallback in EIPs to use reusable static classes

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.20.0
    • camel-core
    • None
    • 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

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

            Dates

              Created:
              Updated:
              Resolved: