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

Config file #5

Closed
kappsegla opened this issue Jan 28, 2022 · 4 comments · Fixed by #60
Closed

Config file #5

kappsegla opened this issue Jan 28, 2022 · 4 comments · Fixed by #60
Assignees

Comments

@kappsegla
Copy link
Contributor

We would like to have some sort of config file for setting some parameters for the server. Example setting port number that the server should listen to.
port=8080

When starting the application the config file should be read and all key and values found should be stored in the applications memory so it can be used by other parts of the program.

Open questions are:

  1. What format should we use for the config file?
  2. Should it be allowed to write any key, value or only some predefined ones with default values if not specified?
  3. What should happen when there are errors in parsing the file?
  4. Where should the file be located, what folder?
@DarkendHall
Copy link
Contributor

Here are my thoughts regarding this:

  1. We could use .json or .yml since they are pretty easy to parse with the jacksson library.
  2. I think it should only be allowed to write some predefined values.
  3. If there is an error while parsing the file we could load some default hardcoded values.
  4. The file should be located in "src/main/resources".

@Vimbayinashe
Copy link
Contributor

I suggest that we use .properties file as suggested in baeldung's article as it does not require an external library and the file can be located in src/main/resources folder as @DarkendHall suggested.

At this point I cannot say exactly which key-value pairs will be required but I am sure this will become clearer over time.

@ReymartNarvaez ReymartNarvaez self-assigned this Jan 31, 2022
@ReymartNarvaez
Copy link
Contributor

I'll do as @DarkendHall suggested and use .json and start working from there.

@LordRekishi
Copy link
Contributor

How is this issue coming along? I could use this for my issue #63

@ReymartNarvaez ReymartNarvaez linked a pull request Feb 11, 2022 that will close this issue
@ReymartNarvaez ReymartNarvaez removed a link to a pull request Feb 11, 2022
@ReymartNarvaez ReymartNarvaez linked a pull request Feb 11, 2022 that will close this issue
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 a pull request may close this issue.

5 participants