Default Scenario
By default, on start API Gateway reads the master configuration file and loads all the defined configuration source files referenced in the master configuration file. If the master configuration config-sources.yml file does not exist or is not valid, API Gateway falls back to its default behavior, that is, the values defined in the internal configuration file become effective. Similarly, if any of the configuration files does not exist or is not valid, then those files are ignored and API Gateway uses the corresponding internal configuration file. The API Gateway server startup is not blocked in the above scenarios. Instead, the error logs are logged into API Gateway application logs for debugging purpose.
Note:
To view the error logs, enable Debug level for the Externalized Configuration facility in the logging settings.
A sample log for an API Gateway instance using externalized configurations is as follows:
[302]2019-08-16 11:19:02 IST [YAI.0013.8889I] [default][SAG-G43RXF2] Configuration loaded from configuration sources. APIGatewayConfig: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='apigw', hosts='localhost:9200', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[301]2019-08-16 11:19:02 IST [YAI.0013.8889I] [default][SAG-G43RXF2] APIGatewayConfig loaded from ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='apigw', hosts='null', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[300]2019-08-16 11:19:02 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Retrieving configuration from Properties file source: ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}
[299]2019-08-16 11:19:02 IST [YAI.0013.8889I] [default][SAG-G43RXF2] APIGatewayConfig loaded from ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='null', hosts='localhost:9200', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[298]2019-08-16 11:19:02 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Retrieving configuration from YAML file source: ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}
[297]2019-08-16 11:19:02 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Loading configuration from sources: [ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}, ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}]
[293]2019-08-16 11:19:01 IST [YAI.0013.8889I] [default][SAG-G43RXF2] Configuration loaded from configuration sources. APIGatewayConfig: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='apigw', hosts='localhost:9200', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[292]2019-08-16 11:19:01 IST [YAI.0013.8889I] [default][SAG-G43RXF2] APIGatewayConfig loaded from ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='apigw', hosts='null', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[291]2019-08-16 11:19:01 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Retrieving configuration from Properties file source: ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}
[290]2019-08-16 11:19:01 IST [YAI.0013.8889I] [default][SAG-G43RXF2] APIGatewayConfig loaded from ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}: APIGatewayConfig{elasticsearch=Elasticsearch{tenantId='null', hosts='localhost:9200', autostart='null', http=null, https=null, sniff=null, outboundProxy=null, clientHttpResponseSize=null, pendingRestart='null'}, kibana=null, filebeat=null, cluster=null}
[289]2019-08-16 11:19:01 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Retrieving configuration from YAML file source: ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}
[288]2019-08-16 11:19:01 IST [YAI.0013.8887D] [default][SAG-G43RXF2] Debug: Loading configuration from sources: [ConfigurationSource{type=YAML, allowEdit=true, properties={location=components.yml}}, ConfigurationSource{type=PROPERTIES, allowEdit=true, properties={location=components.properties}}]
system-settings.yml
API Gateway ships with a default configuration file system-settings.yml, which contains the default values for the inter-component and cluster configurations. The API Gateway Administrator can start API Gateway with the original (default) configuration values by referring to this file in the master configuration file (config-sources.yml) with a higher preference.