philip
philip

Reputation: 504

Loading Properties file into Components in Mule

I have a property file and I want to transform it to a java object that will be used in java components across all flows. What is the best approach for this in Mule CE 3.4

Upvotes: 0

Views: 900

Answers (1)

erencan
erencan

Reputation: 3763

Add property resolver to your configuration. It is mostly done in applicationContext.xml. I am not sure if it is same in your configuration.

 <context:property-placeholder location="classpath:yourfile.properties" />

Then, your properties can be resolved in your beans with the help of @Value annnotation.

@Value("${PropertyName}")
private String propertyValue,

//Setter getter

Upvotes: 3

Related Questions