Documentation Center

About parameters in the Content Delivery client configuration

Rather than providing hardcoded values in your Content Delivery client configuration file cd_client_conf.xml, you can specify strings of the format ${PROPERTYNAME} instead, where PROPERTYNAME is the name of an environment variable or of a property whose value you set when running a script that uses the client configuration file.

An example- setting parameter values at run or install time

For example, to be able to set the value of the cache expiration duration outside cd_client_conf.xml, you could specify a ServiceConfig element as in the following example:
<ServiceConfig
  ConnectionTimeout="1000"
  CacheEnabled="true"
  CacheExpirationDuration="${cache_exp_duration}"
  ServiceAvailabilityCheck="true">
    <DiscoveryService ServiceUri="http://localhost:8082/discovery.svc"/>
    <TokenService ClientId="cduser" ClientSecret="encrypted:o/cgCCwmULfOyUZghFaKJA=="/>  
</ServiceConfig>

The placeholder parameter of the format${PROPERTYNAME} indicates that you should supply the value for this property at startup or install time. In this example, you can supply the CacheExpirationDuration attribute in one of the following ways:

  • as a system environment variable
  • define it in the Java Virtual Machine options
  • define it on the command prompt.
You can turn any quoted string in cd_client_conf.xml into a parameter in this way.
Setting property-value pairs as environment variables

In Unix, use the export command to create environment variables with the names you specified in cd_client_conf.xml, and then give them the right value in each context.

For example, the following Unix command creates an environment variable called CacheExpirationDuration and gives it the value 2000:
export CacheExpirationDuration="2000"

In Windows, you can specify environment variables and their values in the Windows Control Panel in the Advanced tab of the System Properties screen.

Setting property-value pairs in your Java Virtual Machine options

You can use the -D switch to set a property and its value in your startup script's Java Virtual Machine (JVM) options, a sequence of settings called JVM_OPTIONS in Unix or $jvmoptions in Windows.

For example, in addition to setting memory size and the like for the Java Virtual Machine, this Bash script definition for JVM options also sets a property CacheExpirationDuration to the value 2000:
JVM_OPTIONS="-Xrs -Xms256m -Xmx512m -DCacheExpirationDuration=2000"
The format is slightly different for a Windows Powershell script:
$jvmoptions = "-Xrs", "-Xms256m", "-Xmx512m", "-DCacheExpirationDuration=2000"
Setting property-value pairs as script command line switches

You can use the -D command line switch, available for Powershell and Bash scripts, to set a property and its value on the command line.

For example, this command passes a property called CacheExpirationDuration set to 2000 to a Bash script called start.sh:
./start.sh -DCacheExpirationDuration=2000
For Windows Powershell, the format is the same:
start.ps1 -DCacheExpirationDuration=2000