Akka 1.3 had the ability to look up a config variable, and it returned an option, so defaults could be specified.
Akka 2.0 does not have this. So how do I check for the existence of a variable, and specify a default if it is not defined?
Example:
In 1.3: config.getString(“myvariable”, “mydefault”) // default specified
In 2.0: GlobalActorSystem.settings.config.getString(“myvariable”) //no way to specify default
You can use
config.hasPathto find out whether a setting has been specified. But I would recommend that only in the case where you want to attach special meaning to the omission of a setting. If you just want to have a default, include areference.confin your project (at the root of the JAR) which contains that value.