property place holder

8
Property Placeholder

Upload: sivachandra-mandalapu

Post on 12-Jan-2017

27 views

Category:

Education


0 download

TRANSCRIPT

Page 1: Property place holder

Property Placeholder

Page 2: Property place holder

Abstract

The main motto of this PPT is How to use Property Placeholder in our applications.

Page 3: Property place holder

Example

Page 4: Property place holder
Page 5: Property place holder

.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>

Page 6: Property place holder

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

Page 7: Property place holder

Flow of execution:

1. URL to trigger the service from browserhttp://localhost:8086

Note:1. Create myfile-DEV.proerties file in src/main/resources folder2. Specify the env name in mule-app.properties file

Page 8: Property place holder

References

https://docs.mulesoft.com/mule-user-guide/v/3.6/configuring-properties