Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Mule ESB:Context Property Placeholder

Tags:

spring

esb

mule

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

like image 496
insaneyogi Avatar asked Nov 21 '13 19:11

insaneyogi


2 Answers

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.

like image 160
Ryan Hoegg Avatar answered Sep 18 '22 12:09

Ryan Hoegg


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"/>
like image 40
Charu Khurana Avatar answered Sep 18 '22 12:09

Charu Khurana