9

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?

pik4
  • 1,283
  • 3
  • 21
  • 56

1 Answers1

20

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.

simpadjo
  • 3,947
  • 1
  • 13
  • 38
  • 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 '18 at 08:26
  • Suppose that you willl have an answer! https://stackoverflow.com/questions/49978999/externalize-configuration-akka – pik4 Apr 24 '18 at 08: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 '18 at 08: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 '18 at 09:26