Property Placeholder
Abstract
 The main motto of this PPT is How to use Property
Placeholder in our applications.
Example
.mflow
 <?xml version="1.0" encoding="UTF-8"?>
 <mule xmlns:context="http://www.springframework.org/schema/context"
xmlns:http="http://www.mulesoft.org/schema/mule/http"
xmlns="http://www.mulesoft.org/schema/mule/core"
xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"
 xmlns:spring="http://www.springframework.org/schema/beans"
 xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
 xsi:schemaLocation="http://www.springframework.org/schema/beans
http://www.springframework.org/schema/beans/spring-beans-current.xsd
 http://www.mulesoft.org/schema/mule/core
http://www.mulesoft.org/schema/mule/core/current/mule.xsd
 http://www.mulesoft.org/schema/mule/http
http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd
 http://www.springframework.org/schema/context
http://www.springframework.org/schema/context/spring-context-current.xsd">
 <http:listener-config name="HTTP_Listener_Configuration" host="${host}"
port="${port}" doc:name="HTTP Listener Configuration"/>
 <context:property-placeholder location="myfile-${env}.properties"/>
 <flow name="PropertyPlaceHolderFlow">
 <http:listener config-ref="HTTP_Listener_Configuration" path="/"
doc:name="HTTP"/>
 <logger message="--Flow started" level="INFO" doc:name="Logger"/>
 </flow>
 </mule>
 Output:
 *******************************************************************
***
 *******************************************************************
************************************
 * - - + APPLICATION + - - * - - + DOMAIN + - - * - -
+ STATUS + - - *
 *******************************************************************
************************************
 * PropertyPlaceHolder * default *
DEPLOYED *
 *******************************************************************
************************************
 INFO 2016-12-21 09:16:44,431
[[PropertyPlaceHolder].HTTP_Listener_Configuration.worker.01]
org.mule.api.processor.LoggerMessageProcessor: --Flow started
 Flow of execution:
1. URL to trigger the service from browser
http://localhost:8086
Note:
1. Create myfile-DEV.proerties file in
src/main/resources folder
2. Specify the env name in mule-app.properties file
References
 https://docs.mulesoft.com/mule-user-
guide/v/3.6/configuring-properties

Property place holder

  • 1.
  • 2.
    Abstract  The mainmotto of this PPT is How to use Property Placeholder in our applications.
  • 3.
  • 5.
    .mflow  <?xml version="1.0"encoding="UTF-8"?>  <mule xmlns:context="http://www.springframework.org/schema/context" xmlns:http="http://www.mulesoft.org/schema/mule/http" xmlns="http://www.mulesoft.org/schema/mule/core" xmlns:doc="http://www.mulesoft.org/schema/mule/documentation"  xmlns:spring="http://www.springframework.org/schema/beans"  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"  xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-current.xsd  http://www.mulesoft.org/schema/mule/core http://www.mulesoft.org/schema/mule/core/current/mule.xsd  http://www.mulesoft.org/schema/mule/http http://www.mulesoft.org/schema/mule/http/current/mule-http.xsd  http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-current.xsd">  <http:listener-config name="HTTP_Listener_Configuration" host="${host}" port="${port}" doc:name="HTTP Listener Configuration"/>  <context:property-placeholder location="myfile-${env}.properties"/>  <flow name="PropertyPlaceHolderFlow">  <http:listener config-ref="HTTP_Listener_Configuration" path="/" doc:name="HTTP"/>  <logger message="--Flow started" level="INFO" doc:name="Logger"/>  </flow>  </mule>
  • 6.
     Output:  ******************************************************************* *** ******************************************************************* ************************************  * - - + APPLICATION + - - * - - + DOMAIN + - - * - - + STATUS + - - *  ******************************************************************* ************************************  * PropertyPlaceHolder * default * DEPLOYED *  ******************************************************************* ************************************  INFO 2016-12-21 09:16:44,431 [[PropertyPlaceHolder].HTTP_Listener_Configuration.worker.01] org.mule.api.processor.LoggerMessageProcessor: --Flow started
  • 7.
     Flow ofexecution: 1. URL to trigger the service from browser http://localhost:8086 Note: 1. Create myfile-DEV.proerties file in src/main/resources folder 2. Specify the env name in mule-app.properties file
  • 8.