On 14/04/2008, cmoulliard <[EMAIL PROTECTED]> wrote:
>
> Hi,
>
> I would like to know if there a WIKI page describing the class type returned
> by getBody() method of the class Exchange according to the component used ?
>
> In the javadoc of Camel, it is mentioned that the method getBody() returns
> an object. This object corresponds to a class of type java.io.File in the
> case we use the File component (from("file:///c:/temp/test?delete=true"))
Great idea. We should raise a JIRA to track this; it would be handy
information to know.
We should make it easy to diagnose what the body type is; maybe we
should hack the log endpoint to make it easy to log the body content
and type?
http://activemq.apache.org/camel/log.html
> It should be nice to have a table representing such information component by
> component and WHICH class we can use to convert the body
>
> ex :
> - convertBodyTo(String.class) when parsing a file using from("file:///)
> - convertBodyTo(DOMSource.class) when extracting message coming from a JBI
> endpoint
BTW you only need to convert the body if you wanna process it in some
way. e.g. you can just get the body, when using the File component as
a File if you want. Or as a Source if you are using JBI. You only need
to convert to another type if its not the thing you want. e.g. you
could convert a JBI message body to a String if you fancied it etc.
--
James
-------
http://macstrac.blogspot.com/
Open Source Integration
http://open.iona.com