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.
Well you asked how to specify the filename.
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.