Setting the Consul Connection Parameters
You set the values for app properties that you want to override by creating a Key/Value pair for each property in Consul. You can create a standalone property or a hierarchy that groups multiple related properties.
<key_prefix>/<key_name> where
<key_prefix> is a meaningful string or hierarchy that serves as a path to the key in Consul and
<key_name> is the name of the app property whose value you want to override. dev/Timer/Message and
test/Timer/Message,
dev/Timer and
test/Timer are the
<key_prefix> which could stand for the dev and test environments and
Message is the key name. During runtime, you provide the
<key_prefix> value that tells your app the location in Consul from where to access the property values.
Message, is looked up by your app as either
Message or
<key_prefix>/Message in Consul. An app property within a hierarchy such as
x.y.z is looked up as
x/y/z or
<key_prefix>/x/y/z in Consul. Note that the dot in the hierarchy is represented by a forward slash (/) in Consul.
After you have configured the app properties in Consul, you need to set the environment variable,
FLOGO_APP_PROPS_CONSUL, with the Consul connection parameters for your app to connect to the Consul. When you set the environment variable, it triggers the app to run, which connects to the Consul using the Consul connection parameters you provided and pulls the app property values from the
key_prefix location you set by matching the app property name with the
key_name. Hence, the Key names must be identical to the app property names defined in the Environmental Controls tab on the Data Plane.
You can set the
FLOGO_APP_PROPS_CONSUL environment variable by directly entering the values as a JSON string. Add this JSON string to the FLOGO_APP_PROPS_CONSUL engine variable on the Data Plane.
Entering the Consul Parameter Values as a JSON String
To enter the Consul parameters as a JSON string, enter the parameters as key/value pairs using the comma delimiter. The following examples illustrate how to set the values as JSON strings.
FLOGO_APP_PROPS_CONSUL={"server_address":"[http://127.0.0.1:8500|http://127.0.0.1:8500/]"}
Refer to the Consul Connection Parameters section for a description of the parameters. Refer to Encrypting Password Values for details on how to encrypt a value.