Code Monkey home page Code Monkey logo

Comments (9)

vvondra avatar vvondra commented on May 12, 2024 2

A nice touch would be able to override config files, or even by default be able to import them from one another.

config.yml extended by config_prod.yml and config_staging.yml

from dropwizard.

tomakehurst avatar tomakehurst commented on May 12, 2024 1

Hardcoded defaults are pretty awkward for nested config classes e.g. LoggingConfiguration. Where these are immutable it's necessary to subclass them, providing copies of the private attributes with the defaults set. Even when they're mutable and you can default them from your config class's constructor, I suspect the evaluation order would be wrong.

from dropwizard.

codahale avatar codahale commented on May 12, 2024 1

This has come up on the mailing list. The combination of default values in the Configuration fields, configuration file, and command-line overrides is enough complexity.

from dropwizard.

andreisavu avatar andreisavu commented on May 12, 2024

Is this really needed or good hardcoded defaults are enough?

from dropwizard.

frodereinertsen avatar frodereinertsen commented on May 12, 2024

A use case where this feature would make sense is when wanting to keep a config file out of version control, i.e. secrets.yml.

from dropwizard.

adamcath avatar adamcath commented on May 12, 2024

I want this too. Trying to shove defaults into classes I didn't write sounds just too painful, and hard to read. Anyone had success hacking it in?

from dropwizard.

sirianni avatar sirianni commented on May 12, 2024

Layering config files is also important for separating out sensitive values (e.g. mounting a Kubernetes Secret in addition mounting a Kubernetes ConfigMap). Or using the Vault sidecar injector.

Almost all modern java microservice frameworks have this feature.

from dropwizard.

joschi avatar joschi commented on May 12, 2024

@sirianni You can override any setting in the configuration file with a system property or with environment variables.

See also: Using Secrets as environment variables and Dropwizard -> Configuration -> Environment variables.

from dropwizard.

vvondra avatar vvondra commented on May 12, 2024

Layering config files is also important for separating out sensitive values (e.g. mounting a Kubernetes Secret in addition mounting a Kubernetes ConfigMap). Or using the Vault sidecar injector.

Almost all modern java microservice frameworks have this feature.

it's three years since I touched this, but we found a way to plug in this behaviour with our own code: https://github.com/vvondra/dropwizard-config-importable

from dropwizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.