Chapter 6. Configuration Sources and Their Priorities

Configuration Sources

There are several sources of configuration properties. If a property isn't set, application's default setting is used.

Configuration properties can be encrypted (see details in Chapter 10, Secure Configuration Properties).

Warning: Do not combine sources specified below. Configuration becomes confusing and maintenance will be much more difficult.

Environment Variables

Environment variables are variables configured by means of your operating system. E.g. $PATH is an environment variable.

Set environment variable with prefix clover. , i.e. (clover.config.file)

Some operating systems may not use dot (.) character, so underlines (_) may be used instead of dots. So the clover_config_file name works as well.

System Properties

System properties are configured by means of JVM, e.g. with -D argument (-Dclover.config.file).

Set system property with clover. prefix, i.e. (clover.config.file)

Underlines (_) may be used instead of dots (.) so the clover_config_file name works as well.

Properties File on Default Location

Source is a common properties file (text file with key-value pairs):

[property-key]=[property-value]

By default, CloverETL tries to find the config file on the [workingDir]/cloverServer.properties path.

Properties File on Specified Location

A file has the same file structure as in the case above, but its location is specified in the clover_config_file or with a clover.config.file environment variable or system property.

This is the recommended way of configuration if context parameters cannot be set in the application server.

Modification of Context Parameters in web.xml

Unzip clover.war and modify the WEB-INF/web.xml file. Add the following piece of code into the file:

<context-param>
  <param-name>[property-name]</param-name>
  <param-value>[property-value]</param-value>
</context-param>

This way isn't recommended, but it may be useful when none of the approaches above are possible.

Context Parameters (Available on Apache Tomcat)

Some application servers allow you to set context parameters without modification of the WAR file.

This way of configuration is possible, but it is not recommended, as Apache Tomcat may ignore some context parameters in some environments. Use of a properties file is almost as convenient and much more reliable way.

Example for Apache Tomcat

On Tomcat, it is possible to specify context parameters in a context configuration file [Tomcat_home]/conf/Catalina/localhost/clover.xml which is created automatically just after deployment of a CloverETL Server web application.

You can specify a property by adding this element:

<Parameter name="[propertyName]" value="[propertyValue]" override="false" />

Priorities of Configuration Sources

Configuration sources have these priorities:

  1. context parameters (specified in an application server or directly in a web.xml file);

  2. external config file; CS tries to find it in this order. Only one of them is loaded:

    • path specified with a config.file context parameter;

    • path specified with a clover_config_file or clover.config.file system property;

    • path specified with a clover_config_file or clover.config.file environment variable;

    • default location ([workingDir]/cloverServer.properties);

  3. system properties;

  4. environment variables;

  5. default values.