Pivotal Knowledge Base

Follow

How to declaratively specify gfcpp.properties in a native client

Environment

Product Version
Pivotal GemFire Native Client 7.0 and later 

Purpose

This document discusses how to declaratively specify the gfcpp.properties file in a native client.

Cause

The native client and cache server processes first look for their properties file in the {productDir}/defaultSystem directory and, then, in their working directory. Any properties set in the working directory override the settings in the defaultSystem/gfcpp.properties file.

If you are running multiple processes on one machine, you can configure the gfcpp.properties file in the defaultSystem directory as a shared file that all processes can find. If a few processes need a slightly different configuration, you can put individual ".properties" files in their respective home directories to override specific properties.

For web applications such as IIS Express, however, the working directory is the directory where the process is running (for example: C:\Program Files\IISExpress). In this case, it is not possible to have different gfcpp.properties files for each application running on the same machine since they will share this common working directory.

Procedure

The ability to have distinct configurations of properties can be achieved programmatically by creating an instance of the SystemProperties class and using the constructor that takes a path to a properties file as a string. Then pass that object to DistributedSystem.Connect.

 

Additional Information

For further information, please refer to the resources listed below:

.NET

http://data-docs-samples.cfapps.io/docs-gemfire/latest/net_api/DotNetDocs/html/6D19E128.htm

http://data-docs-samples.cfapps.io/docs-gemfire/latest/net_api/DotNetDocs/html/33BFBBA1.htm

CPP

http://data-docs-samples.cfapps.io/docs-gemfire/latest/cpp_api/cppdocs/classgemfire_1_1_distributed_system.html#234f04161d232689a9c46db8d29b9234

http://data-docs-samples.cfapps.io/docs-gemfire/latest/cpp_api/cppdocs/classgemfire_1_1_system_properties.html#939c8aa98a9eaee5966aea51f1a62b96

Comments

Powered by Zendesk