Package io.avaje.config

package io.avaje.config
Application configuration based on loading properties and yaml files.


  int port = Config.getInt("app.port", 8090);

  String topicName = Config.get("");

  List<Integer> codes = Config.getList().ofInt("", 42, 54);


Loading into System properties

If config.load.systemProperties is set to true then all the properties are loaded into System properties.

File watching and reloading

We can enable watching configuration files by setting With this enabled config will watch for modifications to the configuration files and reload the configuration.

By default the files are checked every 60 seconds. We can change this by setting the (which is in seconds). For example setting means the files are checked every every 10 seconds.

By default there is an initial delay of 60 seconds. We can change this by setting

This can provide us a simple "feature toggle" mechanism.

   // we can toggle this on/off by editing the
   // appropriate property in the configuration file
   if (Config.enabled("feature.cleanup", false)) {