-
Notifications
You must be signed in to change notification settings - Fork 2
Builtin Dynocon sources
There are four out of the box sources for the properties:
-
env
- environment variables -
sys
- system variables -
poll-sys
- polling system variables -
poll-urls
- polling URLs
The sources are set using dynocon.sources
parameter:
dynocon.sources=env,sys,dynamodb
Default value is: env,sys,poll-urls
.
env
and sys
providing properties from environment and system varriables. They are not dynamic, the values are retrieved from the corresponding variables at the start-up time. The names of the properties will be the same as the names of the variables.
Example:
export my.property.abc="value xyz"
public static final Property<String> MY_PROP_ABC = new Property<>("my.property.abc", String.class).ifNull("my default value");
poll-sys
and poll-urls
are dynamic properties, the values could change during runtime.
dynocon.system.delay
- delay in seconds the system properties are checked and the properties are updated if the values are changed. Default is a 1-second delay.
dynocon.urls
- comma-separated URLs the properties are retireaved from. Could be file:/
or https://
. Default value is: file:/opt/service.json
.
Example:
export dynocon.urls=file:/opt/my-properties.properties,https://myserver.com/my-remote-propeerties.json
The properties with the same name from the later URL will override the values from the previous URLs.
dynocon.url.delay
- delay in seconds the URLs are called and the values of the properties are updated if changed. Default is 10 seconds.
Custom sources could be injected into Dynocon. See DynamoDB source example.