Hello everyone, as you may guess, I'm very new to ...
# server
m
Hello everyone, as you may guess, I'm very new to Kotlin server side. Do you know any article about best practices or helpful libraries for reading external configs (like the config.maps on kubernetes)?
n
are you using spring boot? or just plain kotlin?
m
It's just plain Kotlin
n
system properties would be the first step https://docs.oracle.com/javase/tutorial/essential/environment/sysprop.html pass
-DXXX=YYY
on the command line
m
Great! I'll give it a try, thanks
n
then inside your app
System.getProperty("XXX")
and it returns
YYY
it starts getting bad when you need to pass a lot of parameters
m
Luckily, I only need it for a very limited number of configs 🙂
👍 1
n
in the case it grows too much the next step is to use this system to point to a file
-Dconfig.file=/etc/myapp/my.properties
then you read the file
have fun!
1
m
👍
t
better late than never : I like the lightbend config stuff much better than system properties. lightbend/config: configuration library for JVM languages using HOCON files (github.com)