10

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?

1 Answer 1

22

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.

4
  • So, when you want to configure the log level, some static context is better to include those variables to application.conf, eight?
    – pik4
    Apr 24, 2018 at 8:26
  • Suppose that you willl have an answer! stackoverflow.com/questions/49978999/…
    – pik4
    Apr 24, 2018 at 8:36
  • One more clarification/confirmation: When you want to configure a thread pool or smth related with this stuff, you include these variables to reference.conf
    – pik4
    Apr 24, 2018 at 8:42
  • If you are not building a library that will be reused in several places you don't need to touch reference.conf at all. Just put all properties in application.conf.
    – simpadjo
    Apr 24, 2018 at 9:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.