Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(server-dropwizard): support configuration overrides from environment variables #590

Closed
wants to merge 3 commits into from

Conversation

dhenneke
Copy link
Contributor

Dropwizard supports configuration overrides by system properties (-D dw.my.property=new-value). This change supports the same name schema in environment variables (export dw.my.property=new-value).

@dhenneke dhenneke force-pushed the feat/environment-variables branch 2 times, most recently from c37c8e2 to 096b992 Compare October 20, 2020 16:23
…ment variables

Dropwizard supports configuration overrides by system properties (-D dw.my.property=new-value). This change supports the same name schema in environment variables (export dw.my.property=new-value).
…ting systems

In Windows, System.genenv(String name) worked, but the result of System.getenv() didn't include the set variables.
@sonarcloud
Copy link

sonarcloud bot commented Oct 21, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities (and Security Hotspot 0 Security Hotspots to review)
Code Smell A 0 Code Smells

97.1% 97.1% Coverage
0.0% 0.0% Duplication

@christopher-cudennec
Copy link
Contributor

I would close this PR since env variables are not really recommended from Java 16+. Okay for you @JoergSiebahn?

@christopher-cudennec
Copy link
Contributor

As discussed: Maybe we can support a scheme like DW_MY_PROPERTY to support magically overriding properties instead of using a ..

@christopher-cudennec
Copy link
Contributor

Leaving one more comment / thought here: Might be a good idea to bring our Dropwizard Commons closer to the configuration possibilities of Spring applications that are based on sda-spring-boot-commons. This would probably mean:

  • overrides would not need a prefix
  • environment variables are translated from "screaming snake case" (MY_VAR) to "dot notation" (my.var)
  • overrides are possible either using system properties or environment variables
  • ...

@JoergSiebahn
Copy link
Contributor

superseded by #2685

@JoergSiebahn JoergSiebahn deleted the feat/environment-variables branch November 24, 2023 12:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants