I'm afraid current Camel doesn't implement this feature. If you want to render the object as you want, I suggest you to write a customer process for your object.
-- Willem Jiang Red Hat, Inc. Web: http://www.redhat.com Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English) http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese) Twitter: willemjiang Weibo: 姜宁willem On Sunday, September 22, 2013 at 5:34 AM, Jamie Archibald wrote: > I'm wondering if camel supports custom object renders (similar to log4j) > when doing the simple expression language? Currently it appears it just > calls toString() on the object > > for example. > > .log("Hello World ${body}"); > > > Rather than calling ${body}.toString() I would like to have it call some > external bean that knows how to render the object. > > For example > > MyCustomRenderer implement ICamelObjectRenderer { > > public String render(MyObject obj) > { > return obj.getName() + obj.getPhoneNumber(); > } > } > > > > -- > Jamie