I am new in Akka and I am trying to understand the difference between the reference.conf
and application.conf
files?
What is the proper way to use them? What kind of variables should I have in each file?
reference. conf is a file for library developers. All properties required by the library should be mentioned there and filled with reasonable default values when possible. application. conf is a file for application developers.
An application configuration file is an XML file used to control assembly binding. It can redirect an application from using one version of a side-by-side assembly to another version of the same assembly. This is called per-application configuration.
Typesafe Config allows you to store configuration into separated files and use include keyword to include configuration of those files. Here is a concrete example for myApp which relies on the configuration of moduleA and moduleB .
reference.conf
is a file for library developers. All properties required by the library should be mentioned there and filled with reasonable default values when possible.
application.conf
is a file for application developers. A developer can set values for properties used by libraries in case they are not the same as defaults.
Also he/she can declare his own properties and refer them from the code.
When ConfigFactory.load
is called all reference.conf
and application.conf
files are merged into one configuration and application.conf
has higher precedence.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With