You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by helander <le...@gmail.com> on 2013/03/18 21:15:14 UTC

Populate message with BeanInvocation

In a route I would like to fill the message with a BeanInvocation, the same
way as when using .bean(....), but I do not want the bean method to be
called. Is there some easy way to do this (preferably using similar syntax
as when using .bean() ) ?

Thanks
Lars



--
View this message in context: http://camel.465427.n5.nabble.com/Populate-message-with-BeanInvocation-tp5729373.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Re: Populate message with BeanInvocation

Posted by Lars-Erik Helander <le...@gmail.com>.
What I would like is really somthing similar to .bean(...) where the bean class and method name is specified to a processor/bean and after invocation of that processor the exchange message body is populated with the appropriate bean invocation. Very much like a camel proxy but expressing the method name in the "DSL" and input parameters in the input message to the processor. 
Another alternative for me would be to use my own processor that would call a proxy, but I need that proxy to use the current exchange (and not the one produced by the proxy) or someway to populate the proxy's exchange (or message headers) with data from the current exchange prior to sending the to the proxy's endpoint.

Thanks
Lars

Skickat från min iPhone

19 mar 2013 kl. 03:38 skrev Willem jiang <wi...@gmail.com>:

> It could be done by writing a custom TypeConverter[1], and you can turn the message body into BeanInvocation like this
> from(xxx).setBody(body(BeanInvocation.class))
> 
> [1] http://camel.apache.org/type-converter.html  
> 
> --  
> Willem Jiang
> 
> Red Hat, Inc.
> FuseSource is now part of Red Hat
> Web: http://www.fusesource.com | http://www.redhat.com
> Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
>          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
> Twitter: willemjiang  
> Weibo: 姜宁willem
> 
> 
> 
> 
> 
> On Tuesday, March 19, 2013 at 4:15 AM, helander wrote:
> 
>> In a route I would like to fill the message with a BeanInvocation, the same
>> way as when using .bean(....), but I do not want the bean method to be
>> called. Is there some easy way to do this (preferably using similar syntax
>> as when using .bean() ) ?
>> 
>> Thanks
>> Lars
>> 
>> 
>> 
>> --
>> View this message in context: http://camel.465427.n5.nabble.com/Populate-message-with-BeanInvocation-tp5729373.html
>> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).
> 
> 
> 

Re: Populate message with BeanInvocation

Posted by Willem jiang <wi...@gmail.com>.
It could be done by writing a custom TypeConverter[1], and you can turn the message body into BeanInvocation like this
from(xxx).setBody(body(BeanInvocation.class))

[1] http://camel.apache.org/type-converter.html  

--  
Willem Jiang

Red Hat, Inc.
FuseSource is now part of Red Hat
Web: http://www.fusesource.com | http://www.redhat.com
Blog: http://willemjiang.blogspot.com (http://willemjiang.blogspot.com/) (English)
          http://jnn.iteye.com (http://jnn.javaeye.com/) (Chinese)
Twitter: willemjiang  
Weibo: 姜宁willem





On Tuesday, March 19, 2013 at 4:15 AM, helander wrote:

> In a route I would like to fill the message with a BeanInvocation, the same
> way as when using .bean(....), but I do not want the bean method to be
> called. Is there some easy way to do this (preferably using similar syntax
> as when using .bean() ) ?
>  
> Thanks
> Lars
>  
>  
>  
> --
> View this message in context: http://camel.465427.n5.nabble.com/Populate-message-with-BeanInvocation-tp5729373.html
> Sent from the Camel - Users mailing list archive at Nabble.com (http://Nabble.com).