You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by mistrz <gr...@edmunds.com> on 2009/12/16 03:20:44 UTC

using a message header for output bean method name

I want to use message header value as the method name that will be invoked on
Output bean.

This will not work because it will be evaluated when the route is created at
start time:

BeanDefinition beanDefinition = new BeanDefinition("beanName",
header("headerName").toString());
routeDefinition.addOutput(beanDefinition);

How can I dynamically configure the BeanDefinition, or is there another way
of accomplishing my goal?

-- 
View this message in context: http://old.nabble.com/using-a-message-header-for-output-bean-method-name-tp26805291p26805291.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: using a message header for output bean method name

Posted by Claus Ibsen <cl...@gmail.com>.
On Wed, Dec 16, 2009 at 3:20 AM, mistrz <gr...@edmunds.com> wrote:
>
> I want to use message header value as the method name that will be invoked on
> Output bean.
>
> This will not work because it will be evaluated when the route is created at
> start time:
>
> BeanDefinition beanDefinition = new BeanDefinition("beanName",
> header("headerName").toString());
> routeDefinition.addOutput(beanDefinition);
>
> How can I dynamically configure the BeanDefinition, or is there another way
> of accomplishing my goal?
>

Yeah you can set the method name to invoke at runtime as a header
(CamelBeanMethodName) on the Exchange IN message.
http://camel.apache.org/bean-binding.html



> --
> View this message in context: http://old.nabble.com/using-a-message-header-for-output-bean-method-name-tp26805291p26805291.html
> Sent from the Camel - Users mailing list archive at Nabble.com.
>
>



-- 
Claus Ibsen
Apache Camel Committer

Author of Camel in Action: http://www.manning.com/ibsen/
Open Source Integration: http://fusesource.com
Blog: http://davsclaus.blogspot.com/
Twitter: http://twitter.com/davsclaus