camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raul Kripalani <>
Subject Re: Camel CXF: In-VM
Date Fri, 10 Aug 2012 14:02:10 GMT

Yes, Camel supports any kind of object as message bodies. Your bean can
declare any type of parameter in methods, including business DTOs, e.g.:

public class CartHandler {
    public CartDTO createCartForOrder(OrderDTO order) {
       return cartDto;

Then instantiate CartHandler in your Spring application context definition:

<bean name="cartHandler" class="org.mycompany.CartHandler" />

You can then use "cartHandler" in your bean endpoint URI, e.g. <to
uri="bean:cartHandler" />, or you could also use the bean DSL as shown in
[1]. With either option, you can specify the method to invoke.

If you happen to receive the DTO in a serialised format in your route (e.g.
XML, JSON, etc.), you can use Data Formats to unmarshal it into an object,
or implement custom logic to process it.

Remember that Camel also has an automatic, transparent type conversion
mechanism you could leverage [2]. IIRC, it is capable of applying JAXB
transformations automatically.



*Raúl Kripalani*
*Principal Consultant | FuseSource Corp. | <>
skype: raul.fuse | twitter: @raulvk <>,
blog: F3 - Flashes From the
 | aboutme:


On 9 August 2012 22:48, objectorange <> wrote:

> I looked into Camel:Bean but all of the examples show RPC-like method calls
> with String as the parameters. Does it support Object parameters? How would
> JAXB be used or would we have to parse incoming XML ourselves in the
> service
> implementation?
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message