Hi

Its fairly common for end users of Camel to send a message to an
endpoint by which the uri is dynamic.

We have a FAQ for that.
http://camel.apache.org/how-do-i-use-dynamic-uri-in-to.html

However you would need to use the recipient list EIP to support that.

Ben O'Day recently created a ticket to improved this, and on the @user
a person is asking for this as well.
https://issues.apache.org/jira/browse/CAMEL-4226

We may want to try to take a stab at improving this. The problem would
be to keep being backwards compatible. And at the same time support
passing in expressions for a to in the DSL. Likewise the DSL may get
big as we would need to add more methods to the model so you can use
the expressions.

The bigger problem is JAXB being a bit of an *** in terms of
flexibility of the generated schema. I remember looking at this years
ago and it wasn't easy to have JAXB generate a XSD where the
expression would be optional. There was no good way of specifying this
in the JAXB annotation in the model class.

But since this could be a good improvement we may want to tamper with
a special support on ToDefinition to force JAXB to see the expression
as being optional.


With this you could write

from X
   to (simple("xxxx:${header.bar}"))


And in XML

<from uri="X"/>
<to><simple>xxx:${header.bar}</simple></to>

Simple is just one of the many expressions you can use.





-- 
Claus Ibsen
-----------------
FuseSource
Email: cib...@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Reply via email to