I am using Camel 2.12.2.
I assume this is supported, but I've been looking and looking all day and
found nothing.
I load properties and apply them to generic routes. All the route's
particulars -- the URI -- are defined in the properties file. The route
knows how to look up its properties because the pattern is static as
follows:
<routeType>.<propertyId>.property
For example,
move.testupload.directory=c:\\Temp
The route resolves these as follows: a) the <propertyId> is passed in as a
header setHeader("propId", "sometest"). The properties are then resolved
like this:
.log("directory = ${properties:move.${header.propId}.dir}")
My first question is: is this a reasonable strategy? Is there a better way
to accomplish this?
My main question is how to use this dynamic property lookup in "file" to
specify the directory?
from("file://<directory> ...")
This doesn't work:
from("file://${properties:move.${header.propId}.dir}?noop=true")
I tried passing in as header. Same problem -- ${} is not allowed in the URI.
I would have thought the file component would have a way to set the
directory as an argument (a la fileName). Some writers have suggested that
you could use fileName= but I have not been able to get it to work.
.from("file://?noop=true&fileName=${properties:move.${header.propsId}.dir}")
I can't use the straight property language because it's not dynamic
("testupload" is hardcoded, not gleaned from a header value).
.from("file://{{move.testupload.from.dir}}?noop=true")
Any specific help is appreciated.
I've used recipientList when the URI is in a to() -- is there a equivalent
to recipientList for from()?
--
View this message in context:
http://camel.465427.n5.nabble.com/Set-directory-at-runtime-with-file-tp5747126.html
Sent from the Camel - Users mailing list archive at Nabble.com.