Skip to content
This repository has been archived by the owner on Mar 17, 2024. It is now read-only.

JSON configuration file support #115

Closed
rkrage opened this issue Jan 22, 2020 · 3 comments
Closed

JSON configuration file support #115

rkrage opened this issue Jan 22, 2020 · 3 comments

Comments

@rkrage
Copy link

rkrage commented Jan 22, 2020

We'd like to dynamically generate JSON to configure the application. Reading through https://github.com/lightbend/config it seems like this should work. In the simple case, it looks like it does, but things start to fall apart when defining custom consumer properties.

When attempting to set the security protocol as such:

"consumer-properties": {
  "security.protocol": "SSL"
}

I see the following error:

No configuration setting found for key 'security'

It seems as though the config parser is converting the key security.protocol into some sort of nested structure.

Any advice on this would be appreciated.

@seglo
Copy link
Owner

seglo commented Jan 23, 2020

If the key is in double quotes then it shouldn't use the nested structure. Can you confirm that the config you're generating has keys in quotes and is not simply `security.protocol: "SSL".

Also, typically = is used for assignments in HOCON, but : will work as well.

Another option is to generate your config as YAML and supply it to the Helm chart (if you're using Helm). It will automatically generate the K8s ConfigMap for you that's compatible with Lightbend Config.

@rkrage
Copy link
Author

rkrage commented Jan 23, 2020

I believe the application actually expects nested keys. In the readme, the example uses client.id = "admin-client-id", which would expand to "client": { "id": "admin-client-id" } in JSON.

So in my case, I just need to do something like:

"consumer-properties": {
  "security": {
    "protocol": "SSL"
  }
}

Closing this for now. Thanks for the response!

@rkrage rkrage closed this as completed Jan 23, 2020
@seglo
Copy link
Owner

seglo commented Jan 23, 2020

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants