Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

This design page is about how to optimize and make Camel 2.x more performant.

Source code

We got an experiment branch at Apache at: https://svn.apache.org/repos/asf/camel/sandbox/tuning-experiment/

You are welcome to checkout the branch and help along with tuning.

Reduce Exchange copying

The first issue to address is to reduce the need for copying exchanges.

Currently Camel does defensive copying of the current Exchange being routed. This happens in org.apache.camel.processor.Pipeline.
This hotspot should be reduced as the Pipeline should not do defensive copy of the Exchange.

Message Facade

We should introduce a message facade to detect mutations to messages.
The code is in org.apache.camel.impl.CopyOnWriteMessageFacade.

IN should be immutable

If IN is immutable it makes redelivery much easier as we just pass in IN yet again.
The code is in org.apache.camel.impl.ImmutableMessage.

Only when redelivering

A defensive copy of the Exchange is only needed when Camel does redelivery using its Error Handler features. So the goal is to move
the defensive copy from the Pipeline to org.apache.camel.processor.RedeliveryErrorHandler. As this error handler is the base for doing redelivery within Camel itself. Then the speed gain is when users do not use this error handler at all.

...