...
If you want to inject parameter values as environment variables, follow the steps given below.
Configuring the synapse artifacts
Define your synapse artifacts using "$SYSTEM:<place_holder_value>" as the parameter value. Note that <place_holder_value> represents a place holder representing the parameter. For example, shown below is an endpoint artifact, where the endpoint uri configured for this feature:
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteEndPoint">
<address uri="$SYSTEM:stockQuoteEP"/>
</endpoint> |
Injecting parameter values
In a VM deployment, you can export the variables as shown below. Here VAR is the url you need to have set as environment property.
Code Block |
---|
export VAR=http://localhost:61616/... |
Injecting parameters using a configuration file
Use separate configuration files to load the parameter values for each environment. For example, a file named dev.properties can be used to inject parameter values to the development environment and a file named prod.properties can be used to inject parameter values to the production environment.
It It is possible to use a file in an NFS mount as the file path and it is useful for container deployment. We can use the environment specific configuration from the file in NFS mount and inject the parameter values to the docker container.
...
. With this feature, it is possible to inject the parameters by using the $FILE: prefix followed by the relevant key used to map the original value.
Configuring the synapse artifacts
Define your synapse artifacts using "$FILE:<place_holder_value>" as the parameter value. Note that <place_holder_value> represents a place holder representing the parameter. For example, shown below is an endpoint artifact, where the endpoint uri configured for this feature:
Code Block |
---|
<?xml version="1.0" encoding="UTF-8"?>
<endpoint xmlns="http://ws.apache.org/ns/synapse" name="StockQuoteEndPoint">
<address uri="$FILE:stockQuoteEP"/>
</endpoint> |
Set up the configuration file
Open the configuration file (such as dev.properties or prod.properties) and enter the parameter and value as a key value pair.
Code Block |
---|
stockQuoteEP=http://localhost:9000/services/SimpleStockQuoteService |
Injecting parameter values
The file path with the name should be defined in the properties.file.path
system variable.
In the the product startup scripts (
integrator.sh
andintegrator.bat
file), which are available in the <EI_HOME>/bin directory, a system variable is defined as follows and the value is set todefault
.Code Block -Dproperties.file.path=default
When the above value set to default, the system reads the parameters from the file.properties file that is available in the
<EI_HOME>/conf
directory. Parameters can define as key-value pair in the file.properties file.
Using custom property files
- In the
Instead of using the file.properties file, you are allowed to use the user defined configuration file similar to the file.properties file and configure the particular file path in the integrator.sh or integrator.bat file as shown below.
...
Localtabgroup Localtab title integrator.sh file:Code Block -Dproperties.file.path=/home/user/ei_configs/dev/dev.properties
Localtab In the title integrator.bat file:Code Block -Dproperties.file.path="%CONFIG_DIR%\dev\dev.properties
...
Supported parameters
Endpoint parameters
...