-
1. Re: Camel File connector - Read a file on demand
davsclaus Oct 4, 2010 6:04 AM (in response to jcs_jean-claude.souvignet)Set the fileName option to the name you would like to consume. See docu
-
2. Re: Camel File connector - Read a file on demand
jcs_jean-claude.souvignet Oct 4, 2010 6:24 AM (in response to davsclaus)thanks,
If I do
Endpoint epRepo = arg0.getContext().getEndpoint("file:D:/Repository/endpointCha?fileName="+MyFileName);
I will have an Endpoint by file.
In my use case hundreds files may be use. It could be inefficient to have so much Endpoints declared, no ?
thanks in advance.
-
3. Re: Camel File connector - Read a file on demand
davsclaus Oct 4, 2010 6:59 AM (in response to jcs_jean-claude.souvignet)Well you asked how to specify the filename.
-
4. Re: Camel File connector - Read a file on demand
ffang Oct 7, 2010 10:17 PM (in response to jcs_jean-claude.souvignet)Hi,
I think you can use property file to specify fileName, so that you only need one endpoint and edit property file during runtime.
If you wanna specify fileName in java code of your camel router bundle, you can use OSGi ConfigAdmin service to load/set properties.
If you specify fileName is spring file of camel context, you can use property placehoder, which also use OSGi ConfigAdmin service.
camel-osgi example shipped with kit demonstrate how to use property placeholder in spring, take a look at the README.txt.
Also here is some similar discussion about this issue from Apache Servicemix mailing list, You may need take a look.
http://servicemix.396122.n5.nabble.com/reading-config-properties-to-a-hashtable-td511758.html
http://servicemix.396122.n5.nabble.com/How-do-I-read-the-property-values-from-ConfigurationAdmin-for-a-PID-from-camel-code-td512223.html
Freeman