Bootstrap configuration

An application can be started without a configuration file, by passing only bootstrap configuration.

Bootstrap configuration includes details required to connect to the Diffusion server, and to register the application with the server. The Gateway framework provides an option to set these bootstrap details as system properties or environment variables, which are used by default, if they are not set in the configuration file.

If a bootstrap configuration is set in both the system property and environment variable, the value of the environment variable will take precedence over the system property.

The allowed system/environment properties are:

Bootstrap system/environment properties
Property Use

gateway.diffusion.url

The Diffusion server URL.

gateway.diffusion.principal

The name of the Diffusion principal (user name) to be used to connect to Diffusion.

gateway.diffusion.password

The Diffusion password for the specified principal.

gateway.client.id

The identifier of the gateway application instance.
Instances of Gateway applications are uniquely identified within the Diffusion console by a combination of the application type (for example Kafka) and the instance relating to a particular configuration (for example,MyKafkaApp).
It defaults to gateway-application-1.

gateway.config.file

The path of configuration file to be used.

gateway.config.use-local-services

A boolean value to specify whether to use service and sharedConfig configuration from the local file, or from the server when application is initialized.
It defaults to false. This can be set to true to override service and sharedConfig configuration available in server with the ones defined in the local file.
This configuration only applies if the application is in DYNAMIC mode.

gateway.config.auto-save-to-file

A boolean value to specify whether to save configuration changes during runtime in the passed config file.
Configuration changes during runtime can be caused due to add/update/removal of services and sharedConfigs.
If for any reason, persisting to file fails, such operation to service will also fail.
If set to true, before making any changes to original config file, a backup of original configuration file will be created.
It defaults to false.
This configuration only applies if the application is in DYNAMIC mode.

gateway.ext.dir

The path of the directory containing any external JARs and zipped files to use with the application. JAR files containing payload converters or custom publishers can be added to this external directory to be loaded in the classpath of the application during startup.

adapter.home

The base path of the directory that contains any Gateway adapter resources. If this is set, it will be used to resolve the directory specified by the gateway.ext.dir property.

If configurations like Diffusion connections details and client id are passed via both system properties or environment variables and in configuration file, the ones in system properties or environment variables will take precedence. If they are set in both the system property and environment variable, the value of the environment variable will take precedence over the system property.

Starting the application using only bootstrap configuration

Use:

java -jar -Dgateway.diffusion.url=ws://localhost:8080 -Dgateway.diffusion.principal=admin -Dgateway.diffusion.password=password -Dgateway.client.id=application-1 application-2.2.0_RC2.jar

The framework attempts to retrieve any previous configuration from the server. If not found, then it assumes the application is starting with an empty configuration. When starting with empty configuration the application can be configured from the Diffusion console.