Ways of setting configuration options

The DCB modules follow specific conventions which allow administrators to make changes to the configuration in a cascading hierarchy of locations.

By default, the DCB modules contain development, test and production deployment profiles. These can be found in src/main/resources as application.yml, application-development.yml and application-test.yml under src/test/resources.

Any yml property can be overridden by specifying an environment variable following specific naming conventions. For example, dcb-service contains the following entry

dcb: itemresolver: code: FirstItem

By specifying an environment variable named DCB_ITEMRESOLVER_CODE=Geo we can override this setting. This is most often done with a config or secret file in a k8s environment.

Additionally, a more complex form of overriding can take the form of an environment variable carrying a JSON payload. For example, the DCB test system carries the following environment variable:

MICRONAUT_APPLICATION_JSON: "{ \"dcb\":{ \"requestability\":{ \"location\": { \"codes\": { \"allowed\":[\"LM1-A1-SL1\",\"LM1-A2-SL1\", \"LM2-A1-SL1\", \"LM2-A2-SL1\", \"LM3-A1-SL1\"] } } } } }"

Which instructs the dcb service to limit requests to a specific subset of location codes. This is a less permanent and more site specific alternative to adding configuration to application.yml.

 

Operated as a Community Resource by the Open Library Foundation