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
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.
- Setting property-value pairs as environment variables
-
In Unix, use the
exportcommand 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 calledCacheExpirationDurationand gives it the value2000: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
-Dswitch to set a property and its value in your startup script's Java Virtual Machine (JVM) options, a sequence of settings calledJVM_OPTIONSin Unix or$jvmoptionsin 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 propertyCacheExpirationDurationto the value2000: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
-Dcommand 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 calledCacheExpirationDurationset to2000to a Bash script called start.sh:./start.sh -DCacheExpirationDuration=2000For Windows Powershell, the format is the same:start.ps1 -DCacheExpirationDuration=2000