Attribute Definition Priority

You can specify attributes in different ways, which can cause conflicting definitions. Applications can be configured programmatically, and that has priority over other settings.

In case an attribute is defined in more than one place, the first source in this list is used:

  • Programmatic configuration
  • Properties set at the command line
  • current-working-directory/ file
  • native-client-installation-directory/defaultSystem/ file
  • defaults

The files and programmatic configuration are optional. If they are not present, no warnings or errors occur. For details on programmatic configuration through the Properties object, see Defining Properties Programmatically.

Search Path for Multiple Properties Files

The client and cache server processes first look for their properties file in the native-client-installation-directory/defaultSystem directory, then in the working directory.

Any properties set in the working directory override settings in the native-client-installation-directory/defaultSystem/ file.

The file provides information to the client regarding the expected server configuration. Properties set in this file (in the client environment) do not have any effect on the server itself. Its main purpose is to inform the client application as to how to communicate with the server.

Defining Properties Programmatically

You can pass in specific properties programmatically by using a Properties object to define the non-default properties.


auto systemProps = Properties::create();
systemProps->insert("statistic-archive-file", "stats.gfs");
systemProps->insert("cache-xml-file", "./myapp-cache.xml");
systemProps->insert("stacktrace-enabled", "true");
auto cache = CacheFactory(systemProps).create();    

About the Configuration File

The file provides local settings required to connect a client to a distributed system, along with settings for licensing, logging, and statistics. See System Properties.

Configuration File Locations

A client looks for a file first in the working directory where the process runs, then in native-client-installation-directory/defaultSystem. Use the defaultSystem directory to group configuration files or to share them among processes for more convenient administration. If is not found, the process starts up with the default settings.

For the cache.xml cache configuration file, a client looks for the path specified by the cache-xml-file attribute in (see System Properties). If the cache.xml is not found, the process starts with an unconfigured cache.

Using the Default Sample File

A sample file is included with the VMware GemFire native client installation in the native-client-installation-directory/defaultSystem directory.

To use this file:

  1. Copy the file to the directory where you start the application.
  2. Uncomment the lines you need and edit the settings as shown in this example:

  3. Start the application.

Default File

# Default C++ distributed system properties
# Copy to current directory and uncomment to override defaults.
## Debugging support, enables stacktraces in  apache::geode::client::Exception.
# The default is false, uncomment to enable stacktraces in exceptions.
## Cache region configuration
## Log file config
# zero indicates use no limit.
# zero indicates use no limit. 

Configuring System Properties for the Client

The typical configuration procedure for a client includes the high-level steps listed below.

  1. Place the file for the application in the working directory or in native-client-installation-directory/defaultSystem.
  2. Place the cache.xml file for the application in the desired location and specify its path using the cache-xml-file property in the file.
  3. Add other attributes to the file as needed for the local system architecture.

Running a Client Out of the Box

If you start a client without any configuration, it uses any attributes set programmatically plus any hard-coded defaults (listed in System Properties). Running with the defaults is a convenient way to learn the operation of the distributed system and to test which attributes need to be reconfigured for your environment.

Running based on defaults is not recommended for production systems, as important components, such as security, might be overlooked.

check-circle-line exclamation-circle-line close-line
Scroll to top icon