Class ConfigurationSubstitutionBundle

java.lang.Object
org.sdase.commons.server.dropwizard.bundles.ConfigurationSubstitutionBundle
All Implemented Interfaces:
io.dropwizard.core.ConfiguredBundle<io.dropwizard.core.Configuration>

public class ConfigurationSubstitutionBundle extends Object implements io.dropwizard.core.ConfiguredBundle<io.dropwizard.core.Configuration>
The ConfigurationSubstitutionBundle allows to use placeholders for environment variables or system properties in configuration yaml files. It should be added as first bundle in the application.

The config.yaml may contain placeholders that are replaced by the content of environment variables or system properties and optional default values:


 server:
   rootPath: ${ROOT_PATH:/api/*}

 

Nested placeholders are supported:


 example: ${EXAMPLE_VALUE:-bar-${EXAMPLE_SUFFIX}}

 
  • Constructor Details

    • ConfigurationSubstitutionBundle

      public ConfigurationSubstitutionBundle()
  • Method Details

    • builder

      public static ConfigurationSubstitutionBundle.Builder builder()
    • initialize

      public void initialize(io.dropwizard.core.setup.Bootstrap<?> bootstrap)
      Specified by:
      initialize in interface io.dropwizard.core.ConfiguredBundle<io.dropwizard.core.Configuration>