Configuration persistence

The configuration passed to the application during start up, or added, or updated via the Diffusion Management console at runtime, is persisted in the Diffusion server. When running the application in DYNAMIC mode, if an application is started with only bootstrap configuration, and configuration for the passed gateway application ID is available in the server, it will be used to instantiate the application, unless overridden using the use-local-services property as described below.

Use of use-local-services

A Gateway application will always need bootstrap configuration to get started. This bootstrap configuration may be defined in the configuration file, passed as system properties, or as environment variables.

When an application is started for the first time with bootstrap configuration, it is registered with the Diffusion server. Its bootstrap configuration and other configuration (if passed via the configuration file) will be persisted in the Diffusion server. Any configuration changes made at runtime from the Diffusion console will be also persisted to the server.

To use the services and sharedConfigs defined in the local configuration file, in preference to the configuration from the server - when re-starting an application, the boolean bootstrap property gateway.config.use-local-services can be used. By default this is false.

The following table shows the outcomes for the various possibilities relating to a local configuration file being supplied, configuration available at the server, and the use of the use-local-services value :

Local file supplied Server config available use-local-services Action

Y

Y

false

Diffusion and global configuration taken from file (or system properties).
Service and sharedConfig configuration taken from the server.

Y

N

false

All configuration from the local file is used.

N

N

false

Bootstrap configuration from properties.
Services defined at runtime (via console) are persisted at the server and available when the application is restarted.

Y

n/a

true

All configuration from the local file is used and replaces anything at the server

N

n/a

true

Gateway Framework throws exception and terminates

If use-local-services is set to true and updates are done to the configuration via the console, such updates will be persisted at the server and will be applied to the running application. However, if the application is restarted again with use-local-services set to true, any such updates will be lost unless gateway.config.auto-save-to-file is set to true as well.