On Thu, Sep 13, 2012 at 4:25 PM, solimo <[email protected]> wrote: > Hello, > > Imagine situation when we have two converters ready to load. The case is > that any of them can alone do desired conversion but chaining them is going > to make it a day. For example: > Converter X can convert type A to B. > Converter Y can convert type B to C. > > Currently if we, for example, send body of type A to to bean's method (via > bean component) which expect one argument of type C (or any argument of > type C annotated @Body) we are going to fail due to type difference and lack > of converter which can perform type A to C conversion. > > Do I miss sth or Camel cannot chain converters (like for example Mule can > do). From what I've seen browsing code it is only being checked if there is > (or can be) instanced converter providing type A to C conversion and if not > then arbitrary argument body will fail. >
Yes chained converters is not supported. However the fallback type converters is more wide scoped, where you can on a case-by-case basis decide to convert. Chained converters can be tricky as they can become non optimal, if the intermediate conversion takes time/memory etc. It would instead often be better to have A -> C directly as converter. Also if there is multiple choices for the chain, which one to pick etc? Type converters has to be fast and slick. > Best regards, > Robert Budźko > > > > -- > View this message in context: > http://camel.465427.n5.nabble.com/Camel-converters-chaining-tp5719295.html > Sent from the Camel - Users mailing list archive at Nabble.com. -- Claus Ibsen ----------------- FuseSource Email: [email protected] Web: http://fusesource.com Twitter: davsclaus, fusenews Blog: http://davsclaus.com Author of Camel in Action: http://www.manning.com/ibsen
