Overriding an App Property at Runtime
While using config management services like Consul or AWS Params store, you can update or override an app property at runtime without restarting or redeploying the app.
Environment Variable | Description |
---|---|
FLOGO_APP_PROP_RECONFIGURE=true | Specifies that app properties can be updated or overridden at runtime. |
FLOGO_APP_PROP_SNAPSHOTS=true | Used along with FLOGO_APP_PROP_RECONFIGURE. If you do not want your application to pick the updated app properties dynamically for a running flow, set this variable to true. The updated values are effective only for new flows and not existing ones. |
FLOGO_HTTP_SERVICE_PORT=<port number> | Specifies the service port. For apps running in TCI, you do not need to specify the port. The default is 7777. |
FLOGO_APP_PROPS_CONSUL="{"server_address":"http://127.0.0.1:8500"}" | Specifies the Consul server address. |
Overriding Values by Specifying New Values
- Procedure
- In the Flogo app, create an app property and map it to the activities as required.
- Create the same key as the app property and add some value.
-
Run the app with the environment variables in the "Before you begin" section.
The app takes all the configured values. - Update the values.
-
To reconfigure the app property values, use the API as follows:
curl -X PUT localhost:7777/app/config/refresh
- Open the app property update logs to verify that the new app property values are used by the activities.
A successful response is returned from the API.
Overriding Values by Specifying New Values in the API Directly
You can specify the new values of app properties directly through the body of the reconfigure API. This method takes priority over any other resolver specified.
Example:
curl -X PUT -H "Content-Type: application/json" -d '{"Property_1":"Value"}' localhost:7777/app/config/refresh
Important Considerations
-
If the same property exists in Consul, the property from the body of the reconfigure API is used.
-
Any new request on the API does not save property values provided on a previous request.
-
Properties mentioned in an earlier request and not mentioned in the new request take values if present from other resolvers mentioned or the last saved value.
-
Properties that are not mentioned in any resolver take the value from TIBCO Cloud Integration.