If the value of a service parameter starts with the sign "$" then that value will be taken from the environment variable.
For example servicetitle parameter value will be taken from STITLE environment variable:
{
"@type": "org.cricketmsf.config.ConfigSet",
"services": [
{
"@type": "org.cricketmsf.config.Configuration",
"id": "MyService",
"service": "com.my.Service",
"properties": {
"servicetitle": "$STITLE",
...
},
"ports": [
....
]
}
}
In case of configuration of adapters, support for this mechanism can be implemented in the adapter's loadProperties method:
E.g.:
public void loadProperties(HashMap<String, String> properties, String adapterName) {
super.loadProperties(properties, adapterName);
token = properties.getOrDefault("token", "");
if (token.startsWith("$")) {
token = System.getenv(token.substring(1));
}
}
If the value of a service parameter starts with the sign "$" then that value will be taken from the environment variable.
For example
servicetitleparameter value will be taken fromSTITLEenvironment variable:In case of configuration of adapters, support for this mechanism can be implemented in the adapter's loadProperties method:
E.g.: