Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Migrated to Confluence 4.0

...

Optimize RedeliveryErrorHandler

DONE in Camel 2.8
A second goal is to implement logic in RedeliveryErrorHandler to only do defensive copying if a redelivery is possible. End users need to explicit enable redelivery in Camel. By implementing logic if a redelivery is ever possible or not we can reduce the copying even further.

...

Logic can be build in to cater for this. For instance:

  • Some interface to indicate whether a Processor can mutate or not.
  • .process can mutate (you get access to the entire Exchange)
  • .bean can mutate (only in some situations)
  • we can allow end users to indicate whether they mutate the exchange or not
  • we can let end users set a flag on the exchange if it was mutated
  • we can add some proxy if getBody/setBody getHeader/setHeader was invoked on IN message to indicate if it was possible to mutate it

We dont have to go all the way, by having just all the Camel component/processors being able to indicate whether they can mutate or not is a big win.
The optimizations of bean/process can be secondary objective as it can be a bit overkill and complex.

...

Claus used YourKit to find the following hot spots:

  • type converter to String could be greatly optimized as it tended to go over fallback converters
  • recipient list with only 1 element could be avoid to not use a Scanner as creating a Scanner costs performance

Performance tests

We should have some performance tests we can run and see what we archive.

...