# directly on SLF4J and your config for the logger backend. # Logger config for Akka internals and classic actors, the new API relies # Copy in parts of the reference files and modify as you please. Custom nfĪ custom nf might look like this: # In this file you can override any option defined in the reference files. See the deployment documentation for information on how to merge the nf resources while bundling. Unfortunately this also means that if you put/merge multiple jars into the same jar, you need to merge all the nf files as well: otherwise all defaults will be lost. All of these will be discovered by the configuration and loaded. Also noteworthy is that the application configuration-which defaults to application-may be overridden using the config.resource property (there are more, please refer to the Config docs).Īkka’s configuration approach relies heavily on the notion of every module/jar having its own nf file. Highest precedence is given to overrides given as system properties, see the HOCON specification (near the bottom). The philosophy is that code never contains default values, but instead relies upon their presence in the nf supplied with the library in question. it internally uses appConfig.withFallback(faultReference(classLoader)) The actor system then merges in all nf resources found at the root of the class path to form the fallback configuration, i.e. This means roughly that the default is to parse all nf, application.json and application.properties found at the root of the class path-please refer to the aforementioned documentation for details. While constructing an actor system, you can either pass in a Config object or not, where the second case is equivalent to passing ConfigFactory.load() (with the right class loader). Where configuration is read fromĪll configuration for Akka is held within instances of ActorSystem ActorSystem, or put differently, as viewed from the outside, ActorSystem ActorSystem is the only consumer of configuration information. This library is implemented in Java with no external dependencies This is only a summary of the most important parts for more details see the config library docs. Typical examples of settings that you might amend:Īkka uses the Typesafe Config Library, which might also be a good choice for the configuration of your own application or library built with or without Akka. Later on you might need to amend the settings to change the default behavior or adapt for specific runtime environments. You can start using Akka without defining any configuration, since sensible default values are provided.
0 Comments
Leave a Reply. |