2008/7/11 cmoulliard <[EMAIL PROTECTED]>:
>
> Hi,
>
> Is there a strategy to define dynamically the
> endpoint/bean/Dataformat/Processor/interceptor (through spring injection,
> ...) of a route ? I will explain my thought through an example
>
> A) Java DSL class
>
> from(endpointA)
> .bean("bean:" + beanA)
> .unmarshall(DataFormatA)
> .to(endpointB)
>
> Remar k :
> - endpointA, endpointB, beanA are String so they can be defined in a
> property file
> - DataFormaA is a DataFormat object. This one must be injected

If you are using Java then all of the parameters to the DSL can be
fields configured at runtime - or dynamic expressions.

However if these endpoints change at runtime (e.g. for each message
received the resultant endpoint is different) then maybe you want to
use a Dynamic RecipientList
http://activemq.apache.org/camel/recipient-list.html

then you can use any expression (including a dynamic method invocation
on a bean) to determine which endpoints to deliver a message to.



>
> B) Spring XML file
>
> Can we do the same here using spring file + properties.file

Due to a pending Spring issue we can't yet use the ${foo.bar} syntax
within the XML
http://jira.springframework.org/browse/SPR-4466

But you can use a dynamic recipient list though.

-- 
James
-------
http://macstrac.blogspot.com/

Open Source Integration
http://open.iona.com

Reply via email to