There are two ways to accomplish your task.
A more easy way:
Camel supports to start and stop the RouteDefintion dynamically,
You can create the RouteDefintion yourself after you reading the file.

A hack way:
If you have the common procedure to handle the files, you can define the common route which start with a Direct endpoint like "direct:start".
Then you can do the following things:
1. Creating the FileEndpoint FileEndpoint yourself according the configure file
2, Creating a SendProcessor which destination is direct endpoint,
3. Creating the FileConsumer with the SendProcessor
4. Manage the FileEndpoint lifecyle yourself.

Willem
----------------------------------
Apache Camel, Apache CXF committer
Open Source Integration http://www.fusesource.com
Blog http://willemjiang.blogspot.com
Tiwtter http://twitter.com/willemjiang

Hossein wrote:
Hello,

Is there anyway to dynamically setup routes? For example, I'm trying to
setup a route using a File component. In that file there will be something
like the following:
MQ_USERS_DATA_TOPIC=/the/file/location

I would like to read this file and then setup a route from above folder to
MQ_USERS_DATA_TOPIC

The content of the above file would be dynamic and the mapping of TOPIC /
file location could grow or shrink.

Thanks



Reply via email to