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

Add TOML and JSON support for quarkus configuration #6

Open
radcortez opened this issue Apr 21, 2021 · 6 comments
Open

Add TOML and JSON support for quarkus configuration #6

radcortez opened this issue Apr 21, 2021 · 6 comments

Comments

@radcortez
Copy link
Collaborator

radcortez commented Apr 21, 2021

Originated by quarkusio/quarkus#14330

@hrstoyanov
Copy link

Thanks @radcortez . From my selfish point of view:

  • YAML is a must (very popular because of Docker and K8s)
  • JSON is a must (all AWS, MS Azure service configurations are using it)
  • TOML is nice to have, it is the future!

@radcortez
Copy link
Collaborator Author

YAML is already covered, right? :)

@gjrtimmer
Copy link

gjrtimmer commented Jun 8, 2023

@radcortez Well currently working on it, and I do not seem to get it to work, only keys which are written to consul as key.name.example=value are the ones that are being picked up by quarkus. How can I make YAML work?

To provide more context:

  • I'm using quarkus.consul-config.properties-value-keys to provide the consul key to the properties file which is in consul K/V.
  • Properties file in consul is marked as YAML.
  • Properties are not being loaded, quarkus refused to start due to missing properties, only when I write the properties as key.subkey=value will the be picked up.

Keys written to K/V as:

app:
  subkey: value

are not being picked up by quarkus.

@gjrtimmer
Copy link

I think I have tracked down the issue as far as I understand it.

 @SuppressWarnings({ "rawtypes", "unchecked" })
        private static Map<String, String> readProperties(String rawData) {
            try (StringReader br = new StringReader(rawData)) {
                final Properties properties = new Properties();
                properties.load(br);
                return (Map<String, String>) (Map) properties;
            } catch (IOException e) {
                throw new UncheckedIOException(e);
            }
        }

when using quarkus.consul-config.properties-value-keys you can define you properties in Consul web UI nicely in YAML, however this is forcing it to a properties map. So when using consul K/V as a backend for your app config it does not support YAML

@gjrtimmer
Copy link

@radcortez @hrstoyanov Please check

@radcortez
Copy link
Collaborator Author

@gjrtimmer I believe you wanted to add these comments to #46? This issue has nothing to do with either YAML or Consul.

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

No branches or pull requests

3 participants