Loading properties as Map in a Mule Flow -
i using mule esb 3.4. in-order configure properties , load .properties file in runtime, use mule property-placeholder component. have requirement extract property values when key dynamic. eg; have store urls multiple applications in properties file (like look-up table). here key app id , value url. need retrieve urls based on app id provided mule-flow part of request. there way achieve this? number of apps may of range 10-15. not want store in data-base , retrieve it. there way achieve using mule via configuration?
you can load them directly map using spring so:
<spring:beans> <spring:bean id="appprops" class="org.springframework.beans.factory.config.propertiesfactorybean"> <spring:property name="singleton" value="true"/> <spring:property name="location" value="classpath:application.properties"/> </spring:bean> </spring:beans>
and access dynamically in flow using mel similar to:
<logger message="my prop #[app.registry.appprops[flowvars.somekey]]" level="info" />
replacing flowvars.somekey want retrieve dynamic key.
Comments
Post a Comment