Hi,
We are using camel FTP and file component and have built an FTP service. We
have multiple FTP servers to which we connect and send/receive data. The
file types which we pull/push are same across customers and so routes are
similar with only differentiating factor being the data specific to each
client. I am trying to layout the configuration so as to put common pieces
into reusable units and have only client specific overrides in client
specific files as follows
1. RouteDefintions.xml - Has the abstracted routes for each type of file.
The URI and other options are referred as for example
<from uri={{FTP.URI}}/{{Folder}}?{{FTPConsumerOptions}}/>
<to uri = file://{{Local.Folder}}?{{FileProducerOptions}}
2. FilterDefinitions.xml - Has all the filter definitions. This is static
across customers
3. FileStoreDefintion.xml - Has file store definition for each type of file.
The file store name should be overridden for each customer and file type
4. CommonDefinitions.xml - Loads a set of property files under the id
"commonProperties" using a bean of type
BridgePropertyPlaceholderConfigurer. Also imports the xml files
a. RouteDefinitions.xml
b. FilterDefintions.xml
c. FileStoreDefinitions.xml
5. <Customer-FTP-Configuration>.xml - Here is what it does
a. Imports CommonDefintions.xml
b. Defines a bean of type PropertyOverrideConfigurer and overrides some
properties from "common properties" bean defined in CommonDefinitions.xml
and sets values for those
c. Import few more customer specific property files which I do using
bean of type PropertyPlaceholderConfigurer
d. Define camelContext and import routes using routeContextRef
Now since all beans are singleton by default I cannot do it for multiple
customers. So I put the scope="prototype" for beans which I will need
instance per customer which includes the BridgePropertyPlaceholderConfigurer
bean since I need to override properties by customer
If I run this, I am not getting values for the overridden properties in my
route configuration. It seems that another instance of
BridgePropertyPlaceholderConfigurer is created just before camel builds the
routes.
If I keep this bean as singleton I cannot run it for multiple customers.
Please suggest me a solution for this.
If I do not use BridgePropertyPlaceholderConfigurer and use only
PropertyPlaceholderConfigurer then there is a problem with property
resolution in routes for properties which are loaded in
CommonDefintions.xml. Only properties which are loaded in customer specific
files are visible. I have tried to give all possible permutation and
combinations for property qualifiers such as {{propertyName}} notation or
{{commonProperties:propertyName}} notation or
${commonProperties.propertyName} but the properties are not resolved
Any help will be greatly appreciated
Also is there a way to have multiple property placeholders which I can merge
and use them in Camel context routes?
Regards
Piyush
--
View this message in context:
http://camel.465427.n5.nabble.com/Help-with-properites-resolution-tp5743374.html
Sent from the Camel - Users mailing list archive at Nabble.com.