camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Willem Jiang <>
Subject Re: Issue setting property on the object which in the exchange body
Date Thu, 29 Jan 2015 10:06:07 GMT
You can use the bean method return the message body just like this

public class Bar {
    public Foo doSomething(@Header("age")Integer age, @Body Foo foo) {
	return foo;


You can find more information about Bean Binding here[1]


Willem Jiang

Red Hat, Inc.
Blog: (English) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem

On January 21, 2015 at 4:27:37 AM, gilboy ( wrote:
> Hi
> In my route, I have a header property on the exchange called age. In the
> body of the exchange I have a person object. I want to set the age property
> on the person object.
> If I do something like the following in my route and have the setAge
> property on the Person bean use the header annotation(e.g.
> setAge(@Header("age")Integer age)) the property will get correctly set.
> However, the setter message is void, hence the body on the exchange gets
> wiped. I can have the setter method return "*this*" but it feels wrong
> ${body.setAge}
> Any other solution?
> Thanks
> Joe
> --
> View this message in context:
> Sent from the Camel - Users mailing list archive at

View raw message