That's actually a pretty solid idea.  I've modified my code to support JAX 
marshalling.


Thank you!


-----Original Message-----
From: Larry Meadors [mailto:[email protected]] 
Sent: Thursday, October 27, 2011 7:18 AM
To: [email protected]
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 <[email protected]> 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: [email protected]
>> To: [email protected]
>> 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
>>
>

Reply via email to