https://github.com/nabsha/mule4-property-placeholder
Mule 4 Property Placeholder Provider
https://github.com/nabsha/mule4-property-placeholder
mule mule-applications mule3 mule4 mulesoft mulesoft-connector
Last synced: 7 months ago
JSON representation
Mule 4 Property Placeholder Provider
- Host: GitHub
- URL: https://github.com/nabsha/mule4-property-placeholder
- Owner: nabsha
- License: mit
- Created: 2019-06-21T07:20:18.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-11-29T02:19:04.000Z (over 6 years ago)
- Last Synced: 2025-07-23T23:33:06.799Z (about 1 year ago)
- Topics: mule, mule-applications, mule3, mule4, mulesoft, mulesoft-connector
- Language: Java
- Size: 66.4 KB
- Stars: 2
- Watchers: 1
- Forks: 4
- Open Issues: 7
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
[](https://search.maven.org/search?q=g:com.github.nabsha.mule4.property.provider%20AND%20a:mule4-property-placeholder-module&core=gav)
[](https://depshield.github.io)
[](https://travis-ci.com/nabsha/mule4-property-placeholder)
[](https://coveralls.io/github/nabsha/mule4-property-placeholder?branch=master)
[](https://opensource.org/licenses/MIT)
# Project Title
A simple mule 4 module that behaves like `context:property-placeholder` available in mule 3
## Description
This plugin targets to implement the same functionality provided `context:property-placeholder` module in mule 3.
## Getting Started
### Dependencies
Add following dependency to your mule 4 application pom.xml
```
com.github.nabsha.mule4.property.provider
mule4-property-placeholder-module
0.0.3
mule-plugin
```
Then simply add in the xml as
```
...
xmlns:mule4-property-placeholder="http://www.mulesoft.org/schema/mule/mule4-property-placeholder"
...
xsi:schemaLocation="
...
http://www.mulesoft.org/schema/mule/mule4-property-placeholder http://www.mulesoft.org/schema/mule/mule4-property-placeholder/current/mule-mule4-property-placeholder.xsd
..."
```
### Resource Lookup Order
| Order | Description |
|-------|------------------------|
| 1 | SystemClassLoader |
| 2 | Mule Resource Provider |
| 3 | File System |
_Note_: Check latest version at [](https://search.maven.org/search?q=g:com.github.nabsha.mule4.property.provider%20AND%20a:mule4-property-placeholder-module&core=gav)
### Usage
```
```
#### Configuration
| Option Name | Type | Required | Default | Description |
|---------------------------|---------|----------|---------|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| location | String | Yes | | The location of the properties file to resolve placeholders against, as a Spring resource location: a URL, a "classpath:" pseudo URL, or a relative file path. Multiple locations may be specified, separated by commas. |
| ignore-resource-not-found | boolean | No | false | Specifies if failure to find the property resource location should be ignored. Default is "false", meaning that if there is no file in the location specified an exception will be raised at runtime. |
| ignore-unresolvable | boolean | No | false | Specifies if failure to find the property value to replace a key should be ignored. Default is "false", meaning that this placeholder configurer will raise an exception if it cannot resolve a key. Set to "true" to allow the configurer to pass on the key to any others in the context that have not yet visited the key in question. |
| file-encoding | String | No | | Specifies the encoding to use for parsing properties files. Default is none, using the java.util.Properties default encoding. Only applies to classic properties files, not to XML files. |
## Help
Please refer to the test cases for more information.
Feel free to raise issues or concerns.
## Version History
* 0.0.4
* Fixed loading properties to first fetch from SystemClassLoader, if not found then Mule resourceProvider else read from file
* 0.0.3
* Fixed loading properties if location property cannot be split
* add test cases to test working with `configuration-properties`
* 0.0.2
* Incase file is not found in classpath, try to load it from filesystem if it exists. [View change](https://github.com/nabsha/mule4-property-placeholder/commit/6e2530029290966b8dee552317b82dcdb267095c)
* 0.0.1
* Initial Release
## License
This project is licensed under the MIT License - see the LICENSE file for details