AKB
AKB

Reputation: 5938

reading properties file from mule server location

I have configuration file as

 <db:oracle-config name="Oracle" host="${db.host}" port="${db.port}" instance="${db.instance}" user="${db.user}" password="${db.password}" doc:name="Oracle"/>
<http:inbound-endpoint exchange-pattern="request-response" host="${hostname}" port="${glport}" doc:name="HTTP" path="url1">

Reading all these properties from the mule-app.properties file, which is working fine.

Now the support team in production requires the content of the properties should be read from server location and not the mule-app.properties. The location of the properties is {mule-server-location}/mydir/app.properties.

1) Is it possible to read the properties file from this location?

2) If not, how can I read some content of the file from the conf directory which is located in {mule-server-location}

I have gone the documents here, it says to use spring context properties place holder, but when i start the local server filenotfound exception throws. In my studio, where do I keep app.properties file?

Upvotes: 1

Views: 1730

Answers (1)

Rupesh Sinha
Rupesh Sinha

Reputation: 158

This is a very simple requirement. You can use property placeholder to meet your requirement.

A sample XML is shown below.

<context:property-placeholder location="file:${mule_home}/conf/myresource.properties"/>

You can also specify multiple files using a comma separator.

Upvotes: 2

Related Questions