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

Demo lightbend / typesafe configuration library #18

Merged
merged 2 commits into from
Dec 25, 2021

Conversation

ghubstan
Copy link
Contributor

Based on #17

This is a simple example of how Misq might use the typesafe / lightbend library (~295Kb) to load all global and sub-module configurations from a single misq.conf file.

  • Dependency constraint added to common-platform's build.gradle

  • Dependency (implemention) declared in common and network build files.

  • Global misq.conf file added to common module's resource folder (might need to move it). This sample configuration contains a network service sub config, but only the "networkIOPool {}" block has real values.

  • Added new MisqConfig class to load misq.conf, and provide a getConfig(String path) method to give any object a typesafe Config instance of any scope: from global, to library, down to smallest grouping of scalar configuration values.

  • Added test to check "networkIOPool" config is loaded with correct values.

  • Replaced hard-coded NETWORK_IO_POOL parameters with values loaded from misq.conf

TODO

The typesafe library can probably support everying Misq will need in terms of configuration, including the ability to merge distinct dev and production configs (sub-module level), as well as property files and json files into a global config.

Upgrade checks to Log4j 2.17.0
See gradle/gradle#19360
This is a simple example of how Misq might use the typesafe library (~295Kb)
to load all global and sub-module configurations from a single misq.conf file.

- Dependency constraint added to common-platform's build.gradle.

- Dependency (implemention) declared in common and network build files.

- Global misq.conf file added to common module's resource folder (might need to move it).
  This sample configuration contains a network service sub config, but only the
  "networkIOPool {}" block has real values.

- Added new MisqConfig class to load misq.conf, and provide a getConfig(String path)
  method to give any object a typesafe Config instance of any scope: from global,
  to library, down to smallest grouping of scalar configuration values.

- Added test to check "networkIOPool" config is loaded with correct values.

- Replaced hard-coded NETWORK_IO_POOL parameters with values loaded from
  misq.conf

TODO

The typesafe library can probably support everying Misq will need in terms of
configuration, including the ability to merge distinct dev and/or production configs
(sub-module level), as well as property files and json files into a global config.
Copy link
Contributor

@chimp1984 chimp1984 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK

@chimp1984 chimp1984 merged commit c25c1aa into bisq-network:main Dec 25, 2021
@ghubstan ghubstan deleted the typesafe-config-poc branch December 26, 2021 15:14
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.

2 participants