camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Calvert, Zach (Zach)** CTR **" <zcalv...@motive.com>
Subject RE: Pass Object Through Route
Date Thu, 27 Oct 2011 13:50:29 GMT
That's actually a pretty solid idea.  I've modified my code to support JAX marshalling.


Thank you!


-----Original Message-----
From: Larry Meadors [mailto:larry.meadors@gmail.com] 
Sent: Thursday, October 27, 2011 7:18 AM
To: users@camel.apache.org
Subject: Re: Pass Object Through Route

Maybe you could use java.beans.XMLEncoder (or something like xstream)
to make it a string. That would work.

On Wed, Oct 26, 2011 at 6:21 PM, Mathieu Lalonde <mrlalonde@live.ca> wrote:
>
>
> Are you sending your message through JMS?If so, the default behavior is to only keep
headers with primitive values and String, Date, BigInteger and primitive wrappers...
> I don't know if this can be customized...http://camel.apache.org/jms.html
>
> Cheers,Mathieu
>
>> From: zcalvert@motive.com
>> To: users@camel.apache.org
>> Date: Wed, 26 Oct 2011 17:53:34 -0500
>> Subject: Pass Object Through Route
>>
>> I have a basic bean object, setters and getters that I want to pass through back
up the Camel route.  It implements serializable and has the generated serialVersionUID.  I
have tried doing
>>
>> message.setHeader("myheader", myBean);
>> message.getExchange().setProperty("myheader", myBean);
>>
>> But on the backend, after calling down the route, the bean doesn't exist.  I can
ask
>> Exchange result = producer.send(exchange);
>> logger.debug("Stuff A: " + exchange.getProperty("myheader"));
>> logger.debug("Stuff B: " + exchange.getOut().getHeader("myheader"));
>> logger.debug("Stuff C: " + exchange.getIn().getHeader("myheader"));
>>
>> All three are null, but when I pass a String instead of the myBean, I get the string
out.  Is there a way to send an actual Object back from an Endpoint?
>>
>>
>>
>>
>>
>> Thanks,
>> Zach Calvert
>>
>

Mime
View raw message