I have a question regarding Mule's context property placeholder, I have two files set up like this:
<context:property-placeholder location="classpath:mule-app-1.properties, file:///etc/mule/conf/mule-app-2.properties" />
Firstly is this a valid configuration, secondly which file will take precedence over the other? app1 or app2 file?
-S
Each will be loaded in turn, overwriting duplicate properties from the first one. So in your case, properties defined in mule-app-2.properties will take precedence.
Towards the end of this article I described using this method to provide environment specific configuration properties.
Yes, you can have multiple files loaded through Mule context property placeholder. Correct way to do it is to place the properties file in src/main/resources
, this folder is in classpath and then specify something like this:
<context:property-placeholder location="mule-app-1.properties, mule-app-2.properties" />
I am not sure why would you want to define duplicate properties in them
EDIT:
To specify order of loading multiple files, use order
attribute:
<context:property-placeholder location="mule-app-1.properties" order="1"/>
<context:property-placeholder location="mule-app-2.properties" order="2"/>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With