Configuration
Loading

Configuration

You can start using Akka without defining any configuration, since sensible default values are provided. Later on you might need to amend the settings to change the default behavior or adapt for specific runtime environments. Typical examples of settings that you might amend:

  • log level and logger backend
  • enable remoting
  • message serializers
  • definition of routers
  • tuning of dispatchers

Akka 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. This library is implemented in Java with no external dependencies; you should have a look at its documentation (in particular about ConfigFactory), which is only summarized in the following.

Warning

If you use Akka from the Scala REPL from the 2.9.x series, and you do not provide your own ClassLoader to the ActorSystem, start the REPL with "-Yrepl-sync" to work around a deficiency in the REPLs provided Context ClassLoader.

§Where configuration is read from

All configuration for Akka is held within instances of ActorSystem, or put differently, as viewed from the outside, ActorSystem is the only consumer of configuration information. 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). This means roughly that the default is to parse all application.conf, application.json and application.properties found at the root of the class path—please refer to the aforementioned documentation for details. The actor system then merges in all reference.conf resources found at the root of the class path to form the fallback configuration, i.e. it internally uses

  1. appConfig.withFallback(ConfigFactory.defaultReference(classLoader))

The philosophy is that code never contains default values, but instead relies upon their presence in the reference.conf supplied with the library in question.

Highest precedence is given to overrides given as system properties, see the HOCON specification (near the bottom). 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).

Note

If you are writing an Akka application, keep you configuration in application.conf at the root of the class path. If you are writing an Akka-based library, keep its configuration in reference.conf at the root of the JAR file.

§When using JarJar, OneJar, Assembly or any jar-bundler

Warning

Akka's configuration approach relies heavily on the notion of every module/jar having its own reference.conf file, all of these will be discovered by the configuration and loaded. Unfortunately this also means that if you put/merge multiple jars into the same jar, you need to merge all the reference.confs as well. Otherwise all defaults will be lost and Akka will not function.

If you are using Maven to package your application, you can also make use of the Apache Maven Shade Plugin support for Resource Transformers to merge all the reference.confs on the build classpath into one.

The plugin configuration might look like this:

  1. <plugin>
  2. <groupId>org.apache.maven.plugins</groupId>
  3. <artifactId>maven-shade-plugin</artifactId>
  4. <version>1.5</version>
  5. <executions>
  6. <execution>
  7. <phase>package</phase>
  8. <goals>
  9. <goal>shade</goal>
  10. </goals>
  11. <configuration>
  12. <shadedArtifactAttached>true</shadedArtifactAttached>
  13. <shadedClassifierName>allinone</shadedClassifierName>
  14. <artifactSet>
  15. <includes>
  16. <include>*:*</include>
  17. </includes>
  18. </artifactSet>
  19. <transformers>
  20. <transformer
  21. implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
  22. <resource>reference.conf</resource>
  23. </transformer>
  24. <transformer
  25. implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
  26. <manifestEntries>
  27. <Main-Class>akka.Main</Main-Class>
  28. </manifestEntries>
  29. </transformer>
  30. </transformers>
  31. </configuration>
  32. </execution>
  33. </executions>
  34. </plugin>

§Custom application.conf

A custom application.conf might look like this:

  1. # In this file you can override any option defined in the reference files.
  2. # Copy in parts of the reference files and modify as you please.
  3.  
  4. akka {
  5.  
  6. # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
  7. # to STDOUT)
  8. loggers = ["akka.event.slf4j.Slf4jLogger"]
  9.  
  10. # Log level used by the configured loggers (see "loggers") as soon
  11. # as they have been started; before that, see "stdout-loglevel"
  12. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  13. loglevel = "DEBUG"
  14.  
  15. # Log level for the very basic logger activated during ActorSystem startup.
  16. # This logger prints the log messages to stdout (System.out).
  17. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  18. stdout-loglevel = "DEBUG"
  19.  
  20. actor {
  21. provider = "akka.cluster.ClusterActorRefProvider"
  22.  
  23. default-dispatcher {
  24. # Throughput for default Dispatcher, set to 1 for as fair as possible
  25. throughput = 10
  26. }
  27. }
  28.  
  29. remote {
  30. # The port clients should connect to. Default is 2552.
  31. netty.tcp.port = 4711
  32. }
  33. }

§Including files

Sometimes it can be useful to include another configuration file, for example if you have one application.conf with all environment independent settings and then override some settings for specific environments.

Specifying system property with -Dconfig.resource=/dev.conf will load the dev.conf file, which includes the application.conf

dev.conf:

  1. include "application"
  2.  
  3. akka {
  4. loglevel = "DEBUG"
  5. }

More advanced include and substitution mechanisms are explained in the HOCON specification.

§Logging of Configuration

If the system or config property akka.log-config-on-start is set to on, then the complete configuration at INFO level when the actor system is started. This is useful when you are uncertain of what configuration is used.

If in doubt, you can also easily and nicely inspect configuration objects before or after using them to construct an actor system:

  1. Welcome to Scala version 2.10.4 (Java HotSpot(TM) 64-Bit Server VM, Java 1.6.0_27).
  2. Type in expressions to have them evaluated.
  3. Type :help for more information.
  4.  
  5. scala> import com.typesafe.config._
  6. import com.typesafe.config._
  7.  
  8. scala> ConfigFactory.parseString("a.b=12")
  9. res0: com.typesafe.config.Config = Config(SimpleConfigObject({"a" : {"b" : 12}}))
  10.  
  11. scala> res0.root.render
  12. res1: java.lang.String =
  13. {
  14. # String: 1
  15. "a" : {
  16. # String: 1
  17. "b" : 12
  18. }
  19. }

The comments preceding every item give detailed information about the origin of the setting (file & line number) plus possible comments which were present, e.g. in the reference configuration. The settings as merged with the reference and parsed by the actor system can be displayed like this:

  1. final ActorSystem system = ActorSystem.create();
  2. System.out.println(system.settings());
  3. // this is a shortcut for system.settings().config().root().render()

§A Word About ClassLoaders

In several places of the configuration file it is possible to specify the fully-qualified class name of something to be instantiated by Akka. This is done using Java reflection, which in turn uses a ClassLoader. Getting the right one in challenging environments like application containers or OSGi bundles is not always trivial, the current approach of Akka is that each ActorSystem implementation stores the current thread’s context class loader (if available, otherwise just its own loader as in this.getClass.getClassLoader) and uses that for all reflective accesses. This implies that putting Akka on the boot class path will yield NullPointerException from strange places: this is simply not supported.

§Application specific settings

The configuration can also be used for application specific settings. A good practice is to place those settings in an Extension, as described in:

§Configuring multiple ActorSystem

If you have more than one ActorSystem (or you're writing a library and have an ActorSystem that may be separate from the application's) you may want to separate the configuration for each system.

Given that ConfigFactory.load() merges all resources with matching name from the whole class path, it is easiest to utilize that functionality and differentiate actor systems within the hierarchy of the configuration:

  1. myapp1 {
  2. akka.loglevel = "WARNING"
  3. my.own.setting = 43
  4. }
  5. myapp2 {
  6. akka.loglevel = "ERROR"
  7. app2.setting = "appname"
  8. }
  9. my.own.setting = 42
  10. my.other.setting = "hello"
  1. val config = ConfigFactory.load()
  2. val app1 = ActorSystem("MyApp1", config.getConfig("myapp1").withFallback(config))
  3. val app2 = ActorSystem("MyApp2",
  4. config.getConfig("myapp2").withOnlyPath("akka").withFallback(config))

These two samples demonstrate different variations of the “lift-a-subtree” trick: in the first case, the configuration accessible from within the actor system is this

  1. akka.loglevel = "WARNING"
  2. my.own.setting = 43
  3. my.other.setting = "hello"
  4. // plus myapp1 and myapp2 subtrees

while in the second one, only the “akka” subtree is lifted, with the following result

  1. akka.loglevel = "ERROR"
  2. my.own.setting = 42
  3. my.other.setting = "hello"
  4. // plus myapp1 and myapp2 subtrees

Note

The configuration library is really powerful, explaining all features exceeds the scope affordable here. In particular not covered are how to include other configuration files within other files (see a small example at Including files) and copying parts of the configuration tree by way of path substitutions.

You may also specify and parse the configuration programmatically in other ways when instantiating the ActorSystem.

  1. import akka.actor.ActorSystem
  2. import com.typesafe.config.ConfigFactory
  3. val customConf = ConfigFactory.parseString("""
  4. akka.actor.deployment {
  5. /my-service {
  6. router = round-robin-pool
  7. nr-of-instances = 3
  8. }
  9. }
  10. """)
  11. // ConfigFactory.load sandwiches customConfig between default reference
  12. // config and default overrides, and then resolves it.
  13. val system = ActorSystem("MySystem", ConfigFactory.load(customConf))

§Reading configuration from a custom location

You can replace or supplement application.conf either in code or using system properties.

If you're using ConfigFactory.load() (which Akka does by default) you can replace application.conf by defining -Dconfig.resource=whatever, -Dconfig.file=whatever, or -Dconfig.url=whatever.

From inside your replacement file specified with -Dconfig.resource and friends, you can include "application" if you still want to use application.{conf,json,properties} as well. Settings specified before include "application" would be overridden by the included file, while those after would override the included file.

In code, there are many customization options.

There are several overloads of ConfigFactory.load(); these allow you to specify something to be sandwiched between system properties (which override) and the defaults (from reference.conf), replacing the usual application.{conf,json,properties} and replacing -Dconfig.file and friends.

The simplest variant of ConfigFactory.load() takes a resource basename (instead of application); myname.conf, myname.json, and myname.properties would then be used instead of application.{conf,json,properties}.

The most flexible variant takes a Config object, which you can load using any method in ConfigFactory. For example you could put a config string in code using ConfigFactory.parseString() or you could make a map and ConfigFactory.parseMap(), or you could load a file.

You can also combine your custom config with the usual config, that might look like:

  1. // make a Config with just your special setting
  2. Config myConfig =
  3. ConfigFactory.parseString("something=somethingElse");
  4. // load the normal config stack (system props,
  5. // then application.conf, then reference.conf)
  6. Config regularConfig =
  7. ConfigFactory.load();
  8. // override regular stack with myConfig
  9. Config combined =
  10. myConfig.withFallback(regularConfig);
  11. // put the result in between the overrides
  12. // (system props) and defaults again
  13. Config complete =
  14. ConfigFactory.load(combined);
  15. // create ActorSystem
  16. ActorSystem system =
  17. ActorSystem.create("myname", complete);

When working with Config objects, keep in mind that there are three "layers" in the cake:

  • ConfigFactory.defaultOverrides() (system properties)
  • the app's settings
  • ConfigFactory.defaultReference() (reference.conf)

The normal goal is to customize the middle layer while leaving the other two alone.

  • ConfigFactory.load() loads the whole stack
  • the overloads of ConfigFactory.load() let you specify a different middle layer
  • the ConfigFactory.parse() variations load single files or resources

To stack two layers, use override.withFallback(fallback); try to keep system props (defaultOverrides()) on top and reference.conf (defaultReference()) on the bottom.

Do keep in mind, you can often just add another include statement in application.conf rather than writing code. Includes at the top of application.conf will be overridden by the rest of application.conf, while those at the bottom will override the earlier stuff.

§Actor Deployment Configuration

Deployment settings for specific actors can be defined in the akka.actor.deployment section of the configuration. In the deployment section it is possible to define things like dispatcher, mailbox, router settings, and remote deployment. Configuration of these features are described in the chapters detailing corresponding topics. An example may look like this:

  1. akka.actor.deployment {
  2.  
  3. # '/user/actorA/actorB' is a remote deployed actor
  4. /actorA/actorB {
  5. remote = "akka.tcp://sampleActorSystem@127.0.0.1:2553"
  6. }
  7. # all direct children of '/user/actorC' have a dedicated dispatcher
  8. "/actorC/*" {
  9. dispatcher = my-dispatcher
  10. }
  11. # '/user/actorD/actorE' has a special priority mailbox
  12. /actorD/actorE {
  13. mailbox = prio-mailbox
  14. }
  15. # '/user/actorF/actorG/actorH' is a random pool
  16. /actorF/actorG/actorH {
  17. router = random-pool
  18. nr-of-instances = 5
  19. }
  20. }
  21.  
  22. my-dispatcher {
  23. fork-join-executor.parallelism-min = 10
  24. fork-join-executor.parallelism-max = 10
  25. }
  26. prio-mailbox {
  27. mailbox-type = "a.b.MyPrioMailbox"
  28. }

Note

The deployment section for a specific actor is identified by the path of the actor relative to /user.

You can use asterisks as wildcard matches for the actor path sections, so you could specify: /*/sampleActor and that would match all sampleActor on that level in the hierarchy. You can also use wildcard in the last position to match all actors at a certain level: /someParent/*. Non-wildcard matches always have higher priority to match than wildcards, so: /foo/bar is considered more specific than /foo/* and only the highest priority match is used. Please note that it cannot be used to partially match section, like this: /foo*/bar, /f*o/bar etc.

§Listing of the Reference Configuration

Each Akka module has a reference configuration file with the default values.

§akka-actor

  1. ####################################
  2. # Akka Actor Reference Config File #
  3. ####################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9. # Akka version, checked against the runtime version of Akka.
  10. version = "2.3.16"
  11.  
  12. # Home directory of Akka, modules in the deploy directory will be loaded
  13. home = ""
  14.  
  15. # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
  16. # to STDOUT)
  17. loggers = ["akka.event.Logging$DefaultLogger"]
  18.  
  19. # Loggers are created and registered synchronously during ActorSystem
  20. # start-up, and since they are actors, this timeout is used to bound the
  21. # waiting time
  22. logger-startup-timeout = 5s
  23.  
  24. # Log level used by the configured loggers (see "loggers") as soon
  25. # as they have been started; before that, see "stdout-loglevel"
  26. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  27. loglevel = "INFO"
  28.  
  29. # Log level for the very basic logger activated during ActorSystem startup.
  30. # This logger prints the log messages to stdout (System.out).
  31. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  32. stdout-loglevel = "WARNING"
  33.  
  34. # Log the complete configuration at INFO level when the actor system is started.
  35. # This is useful when you are uncertain of what configuration is used.
  36. log-config-on-start = off
  37.  
  38. # Log at info level when messages are sent to dead letters.
  39. # Possible values:
  40. # on: all dead letters are logged
  41. # off: no logging of dead letters
  42. # n: positive integer, number of dead letters that will be logged
  43. log-dead-letters = 10
  44.  
  45. # Possibility to turn off logging of dead letters while the actor system
  46. # is shutting down. Logging is only done when enabled by 'log-dead-letters'
  47. # setting.
  48. log-dead-letters-during-shutdown = on
  49.  
  50. # List FQCN of extensions which shall be loaded at actor system startup.
  51. # Should be on the format: 'extensions = ["foo", "bar"]' etc.
  52. # See the Akka Documentation for more info about Extensions
  53. extensions = []
  54.  
  55. # Toggles whether threads created by this ActorSystem should be daemons or not
  56. daemonic = off
  57.  
  58. # JVM shutdown, System.exit(-1), in case of a fatal error,
  59. # such as OutOfMemoryError
  60. jvm-exit-on-fatal-error = on
  61.  
  62. actor {
  63.  
  64. # FQCN of the ActorRefProvider to be used; the below is the built-in default,
  65. # another one is akka.remote.RemoteActorRefProvider in the akka-remote bundle.
  66. provider = "akka.actor.LocalActorRefProvider"
  67.  
  68. # The guardian "/user" will use this class to obtain its supervisorStrategy.
  69. # It needs to be a subclass of akka.actor.SupervisorStrategyConfigurator.
  70. # In addition to the default there is akka.actor.StoppingSupervisorStrategy.
  71. guardian-supervisor-strategy = "akka.actor.DefaultSupervisorStrategy"
  72.  
  73. # Timeout for ActorSystem.actorOf
  74. creation-timeout = 20s
  75.  
  76. # Frequency with which stopping actors are prodded in case they had to be
  77. # removed from their parents
  78. reaper-interval = 5s
  79.  
  80. # Serializes and deserializes (non-primitive) messages to ensure immutability,
  81. # this is only intended for testing.
  82. serialize-messages = off
  83.  
  84. # Serializes and deserializes creators (in Props) to ensure that they can be
  85. # sent over the network, this is only intended for testing. Purely local deployments
  86. # as marked with deploy.scope == LocalScope are exempt from verification.
  87. serialize-creators = off
  88.  
  89. # Timeout for send operations to top-level actors which are in the process
  90. # of being started. This is only relevant if using a bounded mailbox or the
  91. # CallingThreadDispatcher for a top-level actor.
  92. unstarted-push-timeout = 10s
  93.  
  94. typed {
  95. # Default timeout for typed actor methods with non-void return type
  96. timeout = 5s
  97. }
  98. # Mapping between ´deployment.router' short names to fully qualified class names
  99. router.type-mapping {
  100. from-code = "akka.routing.NoRouter"
  101. round-robin-pool = "akka.routing.RoundRobinPool"
  102. round-robin-group = "akka.routing.RoundRobinGroup"
  103. random-pool = "akka.routing.RandomPool"
  104. random-group = "akka.routing.RandomGroup"
  105. balancing-pool = "akka.routing.BalancingPool"
  106. smallest-mailbox-pool = "akka.routing.SmallestMailboxPool"
  107. broadcast-pool = "akka.routing.BroadcastPool"
  108. broadcast-group = "akka.routing.BroadcastGroup"
  109. scatter-gather-pool = "akka.routing.ScatterGatherFirstCompletedPool"
  110. scatter-gather-group = "akka.routing.ScatterGatherFirstCompletedGroup"
  111. tail-chopping-pool = "akka.routing.TailChoppingPool"
  112. tail-chopping-group = "akka.routing.TailChoppingGroup"
  113. consistent-hashing-pool = "akka.routing.ConsistentHashingPool"
  114. consistent-hashing-group = "akka.routing.ConsistentHashingGroup"
  115. }
  116.  
  117. deployment {
  118.  
  119. # deployment id pattern - on the format: /parent/child etc.
  120. default {
  121. # The id of the dispatcher to use for this actor.
  122. # If undefined or empty the dispatcher specified in code
  123. # (Props.withDispatcher) is used, or default-dispatcher if not
  124. # specified at all.
  125. dispatcher = ""
  126.  
  127. # The id of the mailbox to use for this actor.
  128. # If undefined or empty the default mailbox of the configured dispatcher
  129. # is used or if there is no mailbox configuration the mailbox specified
  130. # in code (Props.withMailbox) is used.
  131. # If there is a mailbox defined in the configured dispatcher then that
  132. # overrides this setting.
  133. mailbox = ""
  134.  
  135. # routing (load-balance) scheme to use
  136. # - available: "from-code", "round-robin", "random", "smallest-mailbox",
  137. # "scatter-gather", "broadcast"
  138. # - or: Fully qualified class name of the router class.
  139. # The class must extend akka.routing.CustomRouterConfig and
  140. # have a public constructor with com.typesafe.config.Config
  141. # and optional akka.actor.DynamicAccess parameter.
  142. # - default is "from-code";
  143. # Whether or not an actor is transformed to a Router is decided in code
  144. # only (Props.withRouter). The type of router can be overridden in the
  145. # configuration; specifying "from-code" means that the values specified
  146. # in the code shall be used.
  147. # In case of routing, the actors to be routed to can be specified
  148. # in several ways:
  149. # - nr-of-instances: will create that many children
  150. # - routees.paths: will route messages to these paths using ActorSelection,
  151. # i.e. will not create children
  152. # - resizer: dynamically resizable number of routees as specified in
  153. # resizer below
  154. router = "from-code"
  155.  
  156. # number of children to create in case of a router;
  157. # this setting is ignored if routees.paths is given
  158. nr-of-instances = 1
  159.  
  160. # within is the timeout used for routers containing future calls
  161. within = 5 seconds
  162.  
  163. # number of virtual nodes per node for consistent-hashing router
  164. virtual-nodes-factor = 10
  165.  
  166. tail-chopping-router {
  167. # interval is duration between sending message to next routee
  168. interval = 10 milliseconds
  169. }
  170.  
  171. routees {
  172. # Alternatively to giving nr-of-instances you can specify the full
  173. # paths of those actors which should be routed to. This setting takes
  174. # precedence over nr-of-instances
  175. paths = []
  176. }
  177. # To use a dedicated dispatcher for the routees of the pool you can
  178. # define the dispatcher configuration inline with the property name
  179. # 'pool-dispatcher' in the deployment section of the router.
  180. # For example:
  181. # pool-dispatcher {
  182. # fork-join-executor.parallelism-min = 5
  183. # fork-join-executor.parallelism-max = 5
  184. # }
  185.  
  186. # Routers with dynamically resizable number of routees; this feature is
  187. # enabled by including (parts of) this section in the deployment
  188. resizer {
  189. enabled = off
  190.  
  191. # The fewest number of routees the router should ever have.
  192. lower-bound = 1
  193.  
  194. # The most number of routees the router should ever have.
  195. # Must be greater than or equal to lower-bound.
  196. upper-bound = 10
  197.  
  198. # Threshold used to evaluate if a routee is considered to be busy
  199. # (under pressure). Implementation depends on this value (default is 1).
  200. # 0: number of routees currently processing a message.
  201. # 1: number of routees currently processing a message has
  202. # some messages in mailbox.
  203. # > 1: number of routees with at least the configured pressure-threshold
  204. # messages in their mailbox. Note that estimating mailbox size of
  205. # default UnboundedMailbox is O(N) operation.
  206. pressure-threshold = 1
  207.  
  208. # Percentage to increase capacity whenever all routees are busy.
  209. # For example, 0.2 would increase 20% (rounded up), i.e. if current
  210. # capacity is 6 it will request an increase of 2 more routees.
  211. rampup-rate = 0.2
  212.  
  213. # Minimum fraction of busy routees before backing off.
  214. # For example, if this is 0.3, then we'll remove some routees only when
  215. # less than 30% of routees are busy, i.e. if current capacity is 10 and
  216. # 3 are busy then the capacity is unchanged, but if 2 or less are busy
  217. # the capacity is decreased.
  218. # Use 0.0 or negative to avoid removal of routees.
  219. backoff-threshold = 0.3
  220.  
  221. # Fraction of routees to be removed when the resizer reaches the
  222. # backoffThreshold.
  223. # For example, 0.1 would decrease 10% (rounded up), i.e. if current
  224. # capacity is 9 it will request an decrease of 1 routee.
  225. backoff-rate = 0.1
  226.  
  227. # Number of messages between resize operation.
  228. # Use 1 to resize before each message.
  229. messages-per-resize = 10
  230. }
  231. }
  232. }
  233.  
  234. default-dispatcher {
  235. # Must be one of the following
  236. # Dispatcher, PinnedDispatcher, or a FQCN to a class inheriting
  237. # MessageDispatcherConfigurator with a public constructor with
  238. # both com.typesafe.config.Config parameter and
  239. # akka.dispatch.DispatcherPrerequisites parameters.
  240. # PinnedDispatcher must be used together with executor=thread-pool-executor.
  241. type = "Dispatcher"
  242.  
  243. # Which kind of ExecutorService to use for this dispatcher
  244. # Valid options:
  245. # - "default-executor" requires a "default-executor" section
  246. # - "fork-join-executor" requires a "fork-join-executor" section
  247. # - "thread-pool-executor" requires a "thread-pool-executor" section
  248. # - A FQCN of a class extending ExecutorServiceConfigurator
  249. executor = "default-executor"
  250.  
  251. # This will be used if you have set "executor = "default-executor"".
  252. # If an ActorSystem is created with a given ExecutionContext, this
  253. # ExecutionContext will be used as the default executor for all
  254. # dispatchers in the ActorSystem configured with
  255. # executor = "default-executor". Note that "default-executor"
  256. # is the default value for executor, and therefore used if not
  257. # specified otherwise. If no ExecutionContext is given,
  258. # the executor configured in "fallback" will be used.
  259. default-executor {
  260. fallback = "fork-join-executor"
  261. }
  262.  
  263. # This will be used if you have set "executor = "fork-join-executor""
  264. fork-join-executor {
  265. # Min number of threads to cap factor-based parallelism number to
  266. parallelism-min = 8
  267.  
  268. # The parallelism factor is used to determine thread pool size using the
  269. # following formula: ceil(available processors * factor). Resulting size
  270. # is then bounded by the parallelism-min and parallelism-max values.
  271. parallelism-factor = 3.0
  272.  
  273. # Max number of threads to cap factor-based parallelism number to
  274. parallelism-max = 64
  275.  
  276. # Setting to "FIFO" to use queue like peeking mode which "poll" or "LIFO" to use stack
  277. # like peeking mode which "pop".
  278. task-peeking-mode = "FIFO"
  279. }
  280.  
  281. # This will be used if you have set "executor = "thread-pool-executor""
  282. thread-pool-executor {
  283. # Keep alive time for threads
  284. keep-alive-time = 60s
  285.  
  286. # Min number of threads to cap factor-based core number to
  287. core-pool-size-min = 8
  288.  
  289. # The core pool size factor is used to determine thread pool core size
  290. # using the following formula: ceil(available processors * factor).
  291. # Resulting size is then bounded by the core-pool-size-min and
  292. # core-pool-size-max values.
  293. core-pool-size-factor = 3.0
  294.  
  295. # Max number of threads to cap factor-based number to
  296. core-pool-size-max = 64
  297.  
  298. # Minimum number of threads to cap factor-based max number to
  299. # (if using a bounded task queue)
  300. max-pool-size-min = 8
  301.  
  302. # Max no of threads (if using a bounded task queue) is determined by
  303. # calculating: ceil(available processors * factor)
  304. max-pool-size-factor = 3.0
  305.  
  306. # Max number of threads to cap factor-based max number to
  307. # (if using a bounded task queue)
  308. max-pool-size-max = 64
  309.  
  310. # Specifies the bounded capacity of the task queue (< 1 == unbounded)
  311. task-queue-size = -1
  312.  
  313. # Specifies which type of task queue will be used, can be "array" or
  314. # "linked" (default)
  315. task-queue-type = "linked"
  316.  
  317. # Allow core threads to time out
  318. allow-core-timeout = on
  319. }
  320.  
  321. # How long time the dispatcher will wait for new actors until it shuts down
  322. shutdown-timeout = 1s
  323.  
  324. # Throughput defines the number of messages that are processed in a batch
  325. # before the thread is returned to the pool. Set to 1 for as fair as possible.
  326. throughput = 5
  327.  
  328. # Throughput deadline for Dispatcher, set to 0 or negative for no deadline
  329. throughput-deadline-time = 0ms
  330.  
  331. # For BalancingDispatcher: If the balancing dispatcher should attempt to
  332. # schedule idle actors using the same dispatcher when a message comes in,
  333. # and the dispatchers ExecutorService is not fully busy already.
  334. attempt-teamwork = on
  335.  
  336. # If this dispatcher requires a specific type of mailbox, specify the
  337. # fully-qualified class name here; the actually created mailbox will
  338. # be a subtype of this type. The empty string signifies no requirement.
  339. mailbox-requirement = ""
  340. }
  341.  
  342. default-mailbox {
  343. # FQCN of the MailboxType. The Class of the FQCN must have a public
  344. # constructor with
  345. # (akka.actor.ActorSystem.Settings, com.typesafe.config.Config) parameters.
  346. mailbox-type = "akka.dispatch.UnboundedMailbox"
  347.  
  348. # If the mailbox is bounded then it uses this setting to determine its
  349. # capacity. The provided value must be positive.
  350. # NOTICE:
  351. # Up to version 2.1 the mailbox type was determined based on this setting;
  352. # this is no longer the case, the type must explicitly be a bounded mailbox.
  353. mailbox-capacity = 1000
  354.  
  355. # If the mailbox is bounded then this is the timeout for enqueueing
  356. # in case the mailbox is full. Negative values signify infinite
  357. # timeout, which should be avoided as it bears the risk of dead-lock.
  358. mailbox-push-timeout-time = 10s
  359.  
  360. # For Actor with Stash: The default capacity of the stash.
  361. # If negative (or zero) then an unbounded stash is used (default)
  362. # If positive then a bounded stash is used and the capacity is set using
  363. # the property
  364. stash-capacity = -1
  365. }
  366.  
  367. mailbox {
  368. # Mapping between message queue semantics and mailbox configurations.
  369. # Used by akka.dispatch.RequiresMessageQueue[T] to enforce different
  370. # mailbox types on actors.
  371. # If your Actor implements RequiresMessageQueue[T], then when you create
  372. # an instance of that actor its mailbox type will be decided by looking
  373. # up a mailbox configuration via T in this mapping
  374. requirements {
  375. "akka.dispatch.UnboundedMessageQueueSemantics" =
  376. akka.actor.mailbox.unbounded-queue-based
  377. "akka.dispatch.BoundedMessageQueueSemantics" =
  378. akka.actor.mailbox.bounded-queue-based
  379. "akka.dispatch.DequeBasedMessageQueueSemantics" =
  380. akka.actor.mailbox.unbounded-deque-based
  381. "akka.dispatch.UnboundedDequeBasedMessageQueueSemantics" =
  382. akka.actor.mailbox.unbounded-deque-based
  383. "akka.dispatch.BoundedDequeBasedMessageQueueSemantics" =
  384. akka.actor.mailbox.bounded-deque-based
  385. "akka.dispatch.MultipleConsumerSemantics" =
  386. akka.actor.mailbox.unbounded-queue-based
  387. }
  388.  
  389. unbounded-queue-based {
  390. # FQCN of the MailboxType, The Class of the FQCN must have a public
  391. # constructor with (akka.actor.ActorSystem.Settings,
  392. # com.typesafe.config.Config) parameters.
  393. mailbox-type = "akka.dispatch.UnboundedMailbox"
  394. }
  395.  
  396. bounded-queue-based {
  397. # FQCN of the MailboxType, The Class of the FQCN must have a public
  398. # constructor with (akka.actor.ActorSystem.Settings,
  399. # com.typesafe.config.Config) parameters.
  400. mailbox-type = "akka.dispatch.BoundedMailbox"
  401. }
  402.  
  403. unbounded-deque-based {
  404. # FQCN of the MailboxType, The Class of the FQCN must have a public
  405. # constructor with (akka.actor.ActorSystem.Settings,
  406. # com.typesafe.config.Config) parameters.
  407. mailbox-type = "akka.dispatch.UnboundedDequeBasedMailbox"
  408. }
  409.  
  410. bounded-deque-based {
  411. # FQCN of the MailboxType, The Class of the FQCN must have a public
  412. # constructor with (akka.actor.ActorSystem.Settings,
  413. # com.typesafe.config.Config) parameters.
  414. mailbox-type = "akka.dispatch.BoundedDequeBasedMailbox"
  415. }
  416. }
  417.  
  418. debug {
  419. # enable function of Actor.loggable(), which is to log any received message
  420. # at DEBUG level, see the “Testing Actor Systems” section of the Akka
  421. # Documentation at https://akka.io/docs
  422. receive = off
  423.  
  424. # enable DEBUG logging of all AutoReceiveMessages (Kill, PoisonPill et.c.)
  425. autoreceive = off
  426.  
  427. # enable DEBUG logging of actor lifecycle changes
  428. lifecycle = off
  429.  
  430. # enable DEBUG logging of all LoggingFSMs for events, transitions and timers
  431. fsm = off
  432.  
  433. # enable DEBUG logging of subscription changes on the eventStream
  434. event-stream = off
  435.  
  436. # enable DEBUG logging of unhandled messages
  437. unhandled = off
  438.  
  439. # enable WARN logging of misconfigured routers
  440. router-misconfiguration = off
  441. }
  442.  
  443. # Entries for pluggable serializers and their bindings.
  444. serializers {
  445. java = "akka.serialization.JavaSerializer"
  446. bytes = "akka.serialization.ByteArraySerializer"
  447. }
  448.  
  449. # Class to Serializer binding. You only need to specify the name of an
  450. # interface or abstract base class of the messages. In case of ambiguity it
  451. # is using the most specific configured class, or giving a warning and
  452. # choosing the “first” one.
  453. #
  454. # To disable one of the default serializers, assign its class to "none", like
  455. # "java.io.Serializable" = none
  456. serialization-bindings {
  457. "[B" = bytes
  458. "java.io.Serializable" = java
  459. }
  460.  
  461. # Configuration items which are used by the akka.actor.ActorDSL._ methods
  462. dsl {
  463. # Maximum queue size of the actor created by newInbox(); this protects
  464. # against faulty programs which use select() and consistently miss messages
  465. inbox-size = 1000
  466.  
  467. # Default timeout to assume for operations like Inbox.receive et al
  468. default-timeout = 5s
  469. }
  470. }
  471.  
  472. # Used to set the behavior of the scheduler.
  473. # Changing the default values may change the system behavior drastically so make
  474. # sure you know what you're doing! See the Scheduler section of the Akka
  475. # Documentation for more details.
  476. scheduler {
  477. # The LightArrayRevolverScheduler is used as the default scheduler in the
  478. # system. It does not execute the scheduled tasks on exact time, but on every
  479. # tick, it will run everything that is (over)due. You can increase or decrease
  480. # the accuracy of the execution timing by specifying smaller or larger tick
  481. # duration. If you are scheduling a lot of tasks you should consider increasing
  482. # the ticks per wheel.
  483. # Note that it might take up to 1 tick to stop the Timer, so setting the
  484. # tick-duration to a high value will make shutting down the actor system
  485. # take longer.
  486. tick-duration = 10ms
  487.  
  488. # The timer uses a circular wheel of buckets to store the timer tasks.
  489. # This should be set such that the majority of scheduled timeouts (for high
  490. # scheduling frequency) will be shorter than one rotation of the wheel
  491. # (ticks-per-wheel * ticks-duration)
  492. # THIS MUST BE A POWER OF TWO!
  493. ticks-per-wheel = 512
  494.  
  495. # This setting selects the timer implementation which shall be loaded at
  496. # system start-up.
  497. # The class given here must implement the akka.actor.Scheduler interface
  498. # and offer a public constructor which takes three arguments:
  499. # 1) com.typesafe.config.Config
  500. # 2) akka.event.LoggingAdapter
  501. # 3) java.util.concurrent.ThreadFactory
  502. implementation = akka.actor.LightArrayRevolverScheduler
  503.  
  504. # When shutting down the scheduler, there will typically be a thread which
  505. # needs to be stopped, and this timeout determines how long to wait for
  506. # that to happen. In case of timeout the shutdown of the actor system will
  507. # proceed without running possibly still enqueued tasks.
  508. shutdown-timeout = 5s
  509. }
  510.  
  511. io {
  512.  
  513. # By default the select loops run on dedicated threads, hence using a
  514. # PinnedDispatcher
  515. pinned-dispatcher {
  516. type = "PinnedDispatcher"
  517. executor = "thread-pool-executor"
  518. thread-pool-executor.allow-core-timeout = off
  519. }
  520.  
  521. tcp {
  522.  
  523. # The number of selectors to stripe the served channels over; each of
  524. # these will use one select loop on the selector-dispatcher.
  525. nr-of-selectors = 1
  526.  
  527. # Maximum number of open channels supported by this TCP module; there is
  528. # no intrinsic general limit, this setting is meant to enable DoS
  529. # protection by limiting the number of concurrently connected clients.
  530. # Also note that this is a "soft" limit; in certain cases the implementation
  531. # will accept a few connections more or a few less than the number configured
  532. # here. Must be an integer > 0 or "unlimited".
  533. max-channels = 256000
  534.  
  535. # When trying to assign a new connection to a selector and the chosen
  536. # selector is at full capacity, retry selector choosing and assignment
  537. # this many times before giving up
  538. selector-association-retries = 10
  539.  
  540. # The maximum number of connection that are accepted in one go,
  541. # higher numbers decrease latency, lower numbers increase fairness on
  542. # the worker-dispatcher
  543. batch-accept-limit = 10
  544.  
  545. # The number of bytes per direct buffer in the pool used to read or write
  546. # network data from the kernel.
  547. direct-buffer-size = 128 KiB
  548.  
  549. # The maximal number of direct buffers kept in the direct buffer pool for
  550. # reuse.
  551. direct-buffer-pool-limit = 1000
  552.  
  553. # The duration a connection actor waits for a `Register` message from
  554. # its commander before aborting the connection.
  555. register-timeout = 5s
  556.  
  557. # The maximum number of bytes delivered by a `Received` message. Before
  558. # more data is read from the network the connection actor will try to
  559. # do other work.
  560. # The purpose of this setting is to impose a smaller limit than the
  561. # configured receive buffer size. When using value 'unlimited' it will
  562. # try to read all from the receive buffer.
  563. max-received-message-size = unlimited
  564.  
  565. # Enable fine grained logging of what goes on inside the implementation.
  566. # Be aware that this may log more than once per message sent to the actors
  567. # of the tcp implementation.
  568. trace-logging = off
  569.  
  570. # Fully qualified config path which holds the dispatcher configuration
  571. # to be used for running the select() calls in the selectors
  572. selector-dispatcher = "akka.io.pinned-dispatcher"
  573.  
  574. # Fully qualified config path which holds the dispatcher configuration
  575. # for the read/write worker actors
  576. worker-dispatcher = "akka.actor.default-dispatcher"
  577.  
  578. # Fully qualified config path which holds the dispatcher configuration
  579. # for the selector management actors
  580. management-dispatcher = "akka.actor.default-dispatcher"
  581.  
  582. # Fully qualified config path which holds the dispatcher configuration
  583. # on which file IO tasks are scheduled
  584. file-io-dispatcher = "akka.actor.default-dispatcher"
  585.  
  586. # The maximum number of bytes (or "unlimited") to transfer in one batch
  587. # when using `WriteFile` command which uses `FileChannel.transferTo` to
  588. # pipe files to a TCP socket. On some OS like Linux `FileChannel.transferTo`
  589. # may block for a long time when network IO is faster than file IO.
  590. # Decreasing the value may improve fairness while increasing may improve
  591. # throughput.
  592. file-io-transferTo-limit = 512 KiB
  593.  
  594. # The number of times to retry the `finishConnect` call after being notified about
  595. # OP_CONNECT. Retries are needed if the OP_CONNECT notification doesn't imply that
  596. # `finishConnect` will succeed, which is the case on Android.
  597. finish-connect-retries = 5
  598.  
  599. # On Windows connection aborts are not reliably detected unless an OP_READ is
  600. # registered on the selector _after_ the connection has been reset. This
  601. # workaround enables an OP_CONNECT which forces the abort to be visible on Windows.
  602. # Enabling this setting on other platforms than Windows will cause various failures
  603. # and undefined behavior.
  604. # Possible values of this key are on, off and auto where auto will enable the
  605. # workaround if Windows is detected automatically.
  606. windows-connection-abort-workaround-enabled = off
  607. }
  608.  
  609. udp {
  610.  
  611. # The number of selectors to stripe the served channels over; each of
  612. # these will use one select loop on the selector-dispatcher.
  613. nr-of-selectors = 1
  614.  
  615. # Maximum number of open channels supported by this UDP module Generally
  616. # UDP does not require a large number of channels, therefore it is
  617. # recommended to keep this setting low.
  618. max-channels = 4096
  619.  
  620. # The select loop can be used in two modes:
  621. # - setting "infinite" will select without a timeout, hogging a thread
  622. # - setting a positive timeout will do a bounded select call,
  623. # enabling sharing of a single thread between multiple selectors
  624. # (in this case you will have to use a different configuration for the
  625. # selector-dispatcher, e.g. using "type=Dispatcher" with size 1)
  626. # - setting it to zero means polling, i.e. calling selectNow()
  627. select-timeout = infinite
  628.  
  629. # When trying to assign a new connection to a selector and the chosen
  630. # selector is at full capacity, retry selector choosing and assignment
  631. # this many times before giving up
  632. selector-association-retries = 10
  633.  
  634. # The maximum number of datagrams that are read in one go,
  635. # higher numbers decrease latency, lower numbers increase fairness on
  636. # the worker-dispatcher
  637. receive-throughput = 3
  638.  
  639. # The number of bytes per direct buffer in the pool used to read or write
  640. # network data from the kernel.
  641. direct-buffer-size = 128 KiB
  642.  
  643. # The maximal number of direct buffers kept in the direct buffer pool for
  644. # reuse.
  645. direct-buffer-pool-limit = 1000
  646.  
  647. # The maximum number of bytes delivered by a `Received` message. Before
  648. # more data is read from the network the connection actor will try to
  649. # do other work.
  650. received-message-size-limit = unlimited
  651.  
  652. # Enable fine grained logging of what goes on inside the implementation.
  653. # Be aware that this may log more than once per message sent to the actors
  654. # of the tcp implementation.
  655. trace-logging = off
  656.  
  657. # Fully qualified config path which holds the dispatcher configuration
  658. # to be used for running the select() calls in the selectors
  659. selector-dispatcher = "akka.io.pinned-dispatcher"
  660.  
  661. # Fully qualified config path which holds the dispatcher configuration
  662. # for the read/write worker actors
  663. worker-dispatcher = "akka.actor.default-dispatcher"
  664.  
  665. # Fully qualified config path which holds the dispatcher configuration
  666. # for the selector management actors
  667. management-dispatcher = "akka.actor.default-dispatcher"
  668. }
  669.  
  670. udp-connected {
  671.  
  672. # The number of selectors to stripe the served channels over; each of
  673. # these will use one select loop on the selector-dispatcher.
  674. nr-of-selectors = 1
  675.  
  676. # Maximum number of open channels supported by this UDP module Generally
  677. # UDP does not require a large number of channels, therefore it is
  678. # recommended to keep this setting low.
  679. max-channels = 4096
  680.  
  681. # The select loop can be used in two modes:
  682. # - setting "infinite" will select without a timeout, hogging a thread
  683. # - setting a positive timeout will do a bounded select call,
  684. # enabling sharing of a single thread between multiple selectors
  685. # (in this case you will have to use a different configuration for the
  686. # selector-dispatcher, e.g. using "type=Dispatcher" with size 1)
  687. # - setting it to zero means polling, i.e. calling selectNow()
  688. select-timeout = infinite
  689.  
  690. # When trying to assign a new connection to a selector and the chosen
  691. # selector is at full capacity, retry selector choosing and assignment
  692. # this many times before giving up
  693. selector-association-retries = 10
  694.  
  695. # The maximum number of datagrams that are read in one go,
  696. # higher numbers decrease latency, lower numbers increase fairness on
  697. # the worker-dispatcher
  698. receive-throughput = 3
  699.  
  700. # The number of bytes per direct buffer in the pool used to read or write
  701. # network data from the kernel.
  702. direct-buffer-size = 128 KiB
  703.  
  704. # The maximal number of direct buffers kept in the direct buffer pool for
  705. # reuse.
  706. direct-buffer-pool-limit = 1000
  707.  
  708. # The maximum number of bytes delivered by a `Received` message. Before
  709. # more data is read from the network the connection actor will try to
  710. # do other work.
  711. received-message-size-limit = unlimited
  712.  
  713. # Enable fine grained logging of what goes on inside the implementation.
  714. # Be aware that this may log more than once per message sent to the actors
  715. # of the tcp implementation.
  716. trace-logging = off
  717.  
  718. # Fully qualified config path which holds the dispatcher configuration
  719. # to be used for running the select() calls in the selectors
  720. selector-dispatcher = "akka.io.pinned-dispatcher"
  721.  
  722. # Fully qualified config path which holds the dispatcher configuration
  723. # for the read/write worker actors
  724. worker-dispatcher = "akka.actor.default-dispatcher"
  725.  
  726. # Fully qualified config path which holds the dispatcher configuration
  727. # for the selector management actors
  728. management-dispatcher = "akka.actor.default-dispatcher"
  729. }
  730.  
  731. }
  732.  
  733.  
  734. }

§akka-agent

  1. ####################################
  2. # Akka Agent Reference Config File #
  3. ####################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9. agent {
  10.  
  11. # The dispatcher used for agent-send-off actor
  12. send-off-dispatcher {
  13. executor = thread-pool-executor
  14. type = PinnedDispatcher
  15. }
  16.  
  17. # The dispatcher used for agent-alter-off actor
  18. alter-off-dispatcher {
  19. executor = thread-pool-executor
  20. type = PinnedDispatcher
  21. }
  22. }
  23. }

§akka-camel

  1. ####################################
  2. # Akka Camel Reference Config File #
  3. ####################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9. camel {
  10. # FQCN of the ContextProvider to be used to create or locate a CamelContext
  11. # it must implement akka.camel.ContextProvider and have a no-arg constructor
  12. # the built-in default create a fresh DefaultCamelContext
  13. context-provider = akka.camel.DefaultContextProvider
  14.  
  15. # Whether JMX should be enabled or disabled for the Camel Context
  16. jmx = off
  17. # enable/disable streaming cache on the Camel Context
  18. streamingCache = on
  19. consumer {
  20. # Configured setting which determines whether one-way communications
  21. # between an endpoint and this consumer actor
  22. # should be auto-acknowledged or application-acknowledged.
  23. # This flag has only effect when exchange is in-only.
  24. auto-ack = on
  25.  
  26. # When endpoint is out-capable (can produce responses) reply-timeout is the
  27. # maximum time the endpoint can take to send the response before the message
  28. # exchange fails. This setting is used for out-capable, in-only,
  29. # manually acknowledged communication.
  30. reply-timeout = 1m
  31.  
  32. # The duration of time to await activation of an endpoint.
  33. activation-timeout = 10s
  34. }
  35.  
  36. #Scheme to FQCN mappings for CamelMessage body conversions
  37. conversions {
  38. "file" = "java.io.InputStream"
  39. }
  40. }
  41. }

§akka-cluster

  1. ######################################
  2. # Akka Cluster Reference Config File #
  3. ######################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9.  
  10. cluster {
  11. # Initial contact points of the cluster.
  12. # The nodes to join automatically at startup.
  13. # Comma separated full URIs defined by a string on the form of
  14. # "akka.tcp://system@hostname:port"
  15. # Leave as empty if the node is supposed to be joined manually.
  16. seed-nodes = []
  17.  
  18. # how long to wait for one of the seed nodes to reply to initial join request
  19. seed-node-timeout = 5s
  20.  
  21. # If a join request fails it will be retried after this period.
  22. # Disable join retry by specifying "off".
  23. retry-unsuccessful-join-after = 10s
  24.  
  25. # Should the 'leader' in the cluster be allowed to automatically mark
  26. # unreachable nodes as DOWN after a configured time of unreachability?
  27. # Using auto-down implies that two separate clusters will automatically be
  28. # formed in case of network partition.
  29. # Disable with "off" or specify a duration to enable auto-down.
  30. auto-down-unreachable-after = off
  31. # deprecated in 2.3, use 'auto-down-unreachable-after' instead
  32. auto-down = off
  33.  
  34. # The roles of this member. List of strings, e.g. roles = ["A", "B"].
  35. # The roles are part of the membership information and can be used by
  36. # routers or other services to distribute work to certain member types,
  37. # e.g. front-end and back-end nodes.
  38. roles = []
  39.  
  40. role {
  41. # Minimum required number of members of a certain role before the leader
  42. # changes member status of 'Joining' members to 'Up'. Typically used together
  43. # with 'Cluster.registerOnMemberUp' to defer some action, such as starting
  44. # actors, until the cluster has reached a certain size.
  45. # E.g. to require 2 nodes with role 'frontend' and 3 nodes with role 'backend':
  46. # frontend.min-nr-of-members = 2
  47. # backend.min-nr-of-members = 3
  48. #<role-name>.min-nr-of-members = 1
  49. }
  50.  
  51. # Minimum required number of members before the leader changes member status
  52. # of 'Joining' members to 'Up'. Typically used together with
  53. # 'Cluster.registerOnMemberUp' to defer some action, such as starting actors,
  54. # until the cluster has reached a certain size.
  55. min-nr-of-members = 1
  56.  
  57. # Enable/disable info level logging of cluster events
  58. log-info = on
  59.  
  60. # Enable or disable JMX MBeans for management of the cluster
  61. jmx.enabled = on
  62.  
  63. # how long should the node wait before starting the periodic tasks
  64. # maintenance tasks?
  65. periodic-tasks-initial-delay = 1s
  66.  
  67. # how often should the node send out gossip information?
  68. gossip-interval = 1s
  69. # discard incoming gossip messages if not handled within this duration
  70. gossip-time-to-live = 2s
  71.  
  72. # how often should the leader perform maintenance tasks?
  73. leader-actions-interval = 1s
  74.  
  75. # how often should the node move nodes, marked as unreachable by the failure
  76. # detector, out of the membership ring?
  77. unreachable-nodes-reaper-interval = 1s
  78.  
  79. # How often the current internal stats should be published.
  80. # A value of 0s can be used to always publish the stats, when it happens.
  81. # Disable with "off".
  82. publish-stats-interval = off
  83.  
  84. # The id of the dispatcher to use for cluster actors. If not specified
  85. # default dispatcher is used.
  86. # If specified you need to define the settings of the actual dispatcher.
  87. use-dispatcher = ""
  88.  
  89. # Gossip to random node with newer or older state information, if any with
  90. # this probability. Otherwise Gossip to any random live node.
  91. # Probability value is between 0.0 and 1.0. 0.0 means never, 1.0 means always.
  92. gossip-different-view-probability = 0.8
  93. # Reduced the above probability when the number of nodes in the cluster
  94. # greater than this value.
  95. reduce-gossip-different-view-probability = 400
  96.  
  97. # Settings for the Phi accrual failure detector (http://ddg.jaist.ac.jp/pub/HDY+04.pdf
  98. # [Hayashibara et al]) used by the cluster subsystem to detect unreachable
  99. # members.
  100. failure-detector {
  101.  
  102. # FQCN of the failure detector implementation.
  103. # It must implement akka.remote.FailureDetector and have
  104. # a public constructor with a com.typesafe.config.Config and
  105. # akka.actor.EventStream parameter.
  106. implementation-class = "akka.remote.PhiAccrualFailureDetector"
  107.  
  108. # How often keep-alive heartbeat messages should be sent to each connection.
  109. heartbeat-interval = 1 s
  110.  
  111. # Defines the failure detector threshold.
  112. # A low threshold is prone to generate many wrong suspicions but ensures
  113. # a quick detection in the event of a real crash. Conversely, a high
  114. # threshold generates fewer mistakes but needs more time to detect
  115. # actual crashes.
  116. threshold = 8.0
  117.  
  118. # Number of the samples of inter-heartbeat arrival times to adaptively
  119. # calculate the failure timeout for connections.
  120. max-sample-size = 1000
  121.  
  122. # Minimum standard deviation to use for the normal distribution in
  123. # AccrualFailureDetector. Too low standard deviation might result in
  124. # too much sensitivity for sudden, but normal, deviations in heartbeat
  125. # inter arrival times.
  126. min-std-deviation = 100 ms
  127.  
  128. # Number of potentially lost/delayed heartbeats that will be
  129. # accepted before considering it to be an anomaly.
  130. # This margin is important to be able to survive sudden, occasional,
  131. # pauses in heartbeat arrivals, due to for example garbage collect or
  132. # network drop.
  133. acceptable-heartbeat-pause = 3 s
  134.  
  135. # Number of member nodes that each member will send heartbeat messages to,
  136. # i.e. each node will be monitored by this number of other nodes.
  137. monitored-by-nr-of-members = 5
  138. # After the heartbeat request has been sent the first failure detection
  139. # will start after this period, even though no heartbeat mesage has
  140. # been received.
  141. expected-response-after = 5 s
  142.  
  143. }
  144.  
  145. metrics {
  146. # Enable or disable metrics collector for load-balancing nodes.
  147. enabled = on
  148.  
  149. # FQCN of the metrics collector implementation.
  150. # It must implement akka.cluster.MetricsCollector and
  151. # have public constructor with akka.actor.ActorSystem parameter.
  152. # The default SigarMetricsCollector uses JMX and Hyperic SIGAR, if SIGAR
  153. # is on the classpath, otherwise only JMX.
  154. collector-class = "akka.cluster.SigarMetricsCollector"
  155.  
  156. # How often metrics are sampled on a node.
  157. # Shorter interval will collect the metrics more often.
  158. collect-interval = 3s
  159.  
  160. # How often a node publishes metrics information.
  161. gossip-interval = 3s
  162.  
  163. # How quickly the exponential weighting of past data is decayed compared to
  164. # new data. Set lower to increase the bias toward newer values.
  165. # The relevance of each data sample is halved for every passing half-life
  166. # duration, i.e. after 4 times the half-life, a data sample’s relevance is
  167. # reduced to 6% of its original relevance. The initial relevance of a data
  168. # sample is given by 1 – 0.5 ^ (collect-interval / half-life).
  169. # See http://en.wikipedia.org/wiki/Moving_average#Exponential_moving_average
  170. moving-average-half-life = 12s
  171. }
  172.  
  173. # If the tick-duration of the default scheduler is longer than the
  174. # tick-duration configured here a dedicated scheduler will be used for
  175. # periodic tasks of the cluster, otherwise the default scheduler is used.
  176. # See akka.scheduler settings for more details.
  177. scheduler {
  178. tick-duration = 33ms
  179. ticks-per-wheel = 512
  180. }
  181.  
  182. }
  183.  
  184. # Default configuration for routers
  185. actor.deployment.default {
  186. # MetricsSelector to use
  187. # - available: "mix", "heap", "cpu", "load"
  188. # - or: Fully qualified class name of the MetricsSelector class.
  189. # The class must extend akka.cluster.routing.MetricsSelector
  190. # and have a public constructor with com.typesafe.config.Config
  191. # parameter.
  192. # - default is "mix"
  193. metrics-selector = mix
  194. }
  195. actor.deployment.default.cluster {
  196. # enable cluster aware router that deploys to nodes in the cluster
  197. enabled = off
  198.  
  199. # Maximum number of routees that will be deployed on each cluster
  200. # member node.
  201. # Note that nr-of-instances defines total number of routees, but
  202. # number of routees per node will not be exceeded, i.e. if you
  203. # define nr-of-instances = 50 and max-nr-of-instances-per-node = 2
  204. # it will deploy 2 routees per new member in the cluster, up to
  205. # 25 members.
  206. max-nr-of-instances-per-node = 1
  207.  
  208. # Defines if routees are allowed to be located on the same node as
  209. # the head router actor, or only on remote nodes.
  210. # Useful for master-worker scenario where all routees are remote.
  211. allow-local-routees = on
  212.  
  213. # Deprecated in 2.3, use routees.paths instead
  214. routees-path = ""
  215.  
  216. # Use members with specified role, or all members if undefined or empty.
  217. use-role = ""
  218.  
  219. }
  220.  
  221. # Protobuf serializer for cluster messages
  222. actor {
  223. serializers {
  224. akka-cluster = "akka.cluster.protobuf.ClusterMessageSerializer"
  225. }
  226.  
  227. serialization-bindings {
  228. "akka.cluster.ClusterMessage" = akka-cluster
  229. }
  230. router.type-mapping {
  231. adaptive-pool = "akka.cluster.routing.AdaptiveLoadBalancingPool"
  232. adaptive-group = "akka.cluster.routing.AdaptiveLoadBalancingGroup"
  233. }
  234. }
  235.  
  236. }

§akka-multi-node-testkit

  1. #############################################
  2. # Akka Remote Testing Reference Config File #
  3. #############################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9. testconductor {
  10.  
  11. # Timeout for joining a barrier: this is the maximum time any participants
  12. # waits for everybody else to join a named barrier.
  13. barrier-timeout = 30s
  14. # Timeout for interrogation of TestConductor’s Controller actor
  15. query-timeout = 5s
  16. # Threshold for packet size in time unit above which the failure injector will
  17. # split the packet and deliver in smaller portions; do not give value smaller
  18. # than HashedWheelTimer resolution (would not make sense)
  19. packet-split-threshold = 100ms
  20. # amount of time for the ClientFSM to wait for the connection to the conductor
  21. # to be successful
  22. connect-timeout = 20s
  23. # Number of connect attempts to be made to the conductor controller
  24. client-reconnects = 10
  25. # minimum time interval which is to be inserted between reconnect attempts
  26. reconnect-backoff = 1s
  27.  
  28. netty {
  29. # (I&O) Used to configure the number of I/O worker threads on server sockets
  30. server-socket-worker-pool {
  31. # Min number of threads to cap factor-based number to
  32. pool-size-min = 1
  33.  
  34. # The pool size factor is used to determine thread pool size
  35. # using the following formula: ceil(available processors * factor).
  36. # Resulting size is then bounded by the pool-size-min and
  37. # pool-size-max values.
  38. pool-size-factor = 1.0
  39.  
  40. # Max number of threads to cap factor-based number to
  41. pool-size-max = 2
  42. }
  43.  
  44. # (I&O) Used to configure the number of I/O worker threads on client sockets
  45. client-socket-worker-pool {
  46. # Min number of threads to cap factor-based number to
  47. pool-size-min = 1
  48.  
  49. # The pool size factor is used to determine thread pool size
  50. # using the following formula: ceil(available processors * factor).
  51. # Resulting size is then bounded by the pool-size-min and
  52. # pool-size-max values.
  53. pool-size-factor = 1.0
  54.  
  55. # Max number of threads to cap factor-based number to
  56. pool-size-max = 2
  57. }
  58. }
  59. }
  60. }

§akka-persistence

  1. ##########################################
  2. # Akka Persistence Reference Config File #
  3. ##########################################
  4.  
  5.  
  6.  
  7. akka {
  8.  
  9. # Protobuf serialization for persistent messages
  10. actor {
  11.  
  12. serializers {
  13.  
  14. akka-persistence-snapshot = "akka.persistence.serialization.SnapshotSerializer"
  15. akka-persistence-message = "akka.persistence.serialization.MessageSerializer"
  16. }
  17.  
  18. serialization-bindings {
  19.  
  20. "akka.persistence.serialization.Snapshot" = akka-persistence-snapshot
  21. "akka.persistence.serialization.Message" = akka-persistence-message
  22. }
  23. }
  24.  
  25. persistence {
  26.  
  27. journal {
  28.  
  29. # Maximum size of a persistent message batch written to the journal.
  30. max-message-batch-size = 200
  31.  
  32. # Maximum size of a confirmation batch written to the journal.
  33. max-confirmation-batch-size = 10000
  34.  
  35. # Maximum size of a deletion batch written to the journal.
  36. max-deletion-batch-size = 10000
  37.  
  38. # Path to the journal plugin to be used
  39. plugin = "akka.persistence.journal.leveldb"
  40.  
  41. # In-memory journal plugin.
  42. inmem {
  43.  
  44. # Class name of the plugin.
  45. class = "akka.persistence.journal.inmem.InmemJournal"
  46.  
  47. # Dispatcher for the plugin actor.
  48. plugin-dispatcher = "akka.actor.default-dispatcher"
  49. }
  50.  
  51. # LevelDB journal plugin.
  52. leveldb {
  53.  
  54. # Class name of the plugin.
  55. class = "akka.persistence.journal.leveldb.LeveldbJournal"
  56.  
  57. # Dispatcher for the plugin actor.
  58. plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
  59.  
  60. # Dispatcher for message replay.
  61. replay-dispatcher = "akka.persistence.dispatchers.default-replay-dispatcher"
  62.  
  63. # Storage location of LevelDB files.
  64. dir = "journal"
  65.  
  66. # Use fsync on write
  67. fsync = on
  68.  
  69. # Verify checksum on read.
  70. checksum = off
  71.  
  72. # Native LevelDB (via JNI) or LevelDB Java port
  73. native = on
  74. }
  75.  
  76. # Shared LevelDB journal plugin (for testing only).
  77. leveldb-shared {
  78.  
  79. # Class name of the plugin.
  80. class = "akka.persistence.journal.leveldb.SharedLeveldbJournal"
  81.  
  82. # Dispatcher for the plugin actor.
  83. plugin-dispatcher = "akka.actor.default-dispatcher"
  84. # timeout for async journal operations
  85. timeout = 10s
  86.  
  87. store {
  88.  
  89. # Dispatcher for shared store actor.
  90. store-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
  91.  
  92. # Dispatcher for message replay.
  93. replay-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
  94.  
  95. # Storage location of LevelDB files.
  96. dir = "journal"
  97.  
  98. # Use fsync on write
  99. fsync = on
  100.  
  101. # Verify checksum on read.
  102. checksum = off
  103.  
  104. # Native LevelDB (via JNI) or LevelDB Java port
  105. native = on
  106. }
  107. }
  108. }
  109.  
  110. snapshot-store {
  111.  
  112. # Path to the snapshot store plugin to be used
  113. plugin = "akka.persistence.snapshot-store.local"
  114.  
  115. # Local filesystem snapshot store plugin.
  116. local {
  117.  
  118. # Class name of the plugin.
  119. class = "akka.persistence.snapshot.local.LocalSnapshotStore"
  120.  
  121. # Dispatcher for the plugin actor.
  122. plugin-dispatcher = "akka.persistence.dispatchers.default-plugin-dispatcher"
  123.  
  124. # Dispatcher for streaming snapshot IO.
  125. stream-dispatcher = "akka.persistence.dispatchers.default-stream-dispatcher"
  126.  
  127. # Storage location of snapshot files.
  128. dir = "snapshots"
  129. }
  130. }
  131.  
  132. view {
  133.  
  134. # Automated incremental view update.
  135. auto-update = on
  136.  
  137. # Interval between incremental updates
  138. auto-update-interval = 5s
  139.  
  140. # Maximum number of messages to replay per incremental view update. Set to
  141. # -1 for no upper limit.
  142. auto-update-replay-max = -1
  143. }
  144. at-least-once-delivery {
  145. # Interval between redelivery attempts
  146. redeliver-interval = 5s
  147. # After this number of delivery attempts a `ReliableRedelivery.UnconfirmedWarning`
  148. # message will be sent to the actor.
  149. warn-after-number-of-unconfirmed-attempts = 5
  150. # Maximum number of unconfirmed messages that an actor with AtLeastOnceDelivery is
  151. # allowed to hold in memory.
  152. max-unconfirmed-messages = 100000
  153. }
  154.  
  155. dispatchers {
  156. default-plugin-dispatcher {
  157. type = PinnedDispatcher
  158. executor = "thread-pool-executor"
  159. }
  160. default-replay-dispatcher {
  161. type = Dispatcher
  162. executor = "fork-join-executor"
  163. fork-join-executor {
  164. parallelism-min = 2
  165. parallelism-max = 8
  166. }
  167. }
  168. default-stream-dispatcher {
  169. type = Dispatcher
  170. executor = "fork-join-executor"
  171. fork-join-executor {
  172. parallelism-min = 2
  173. parallelism-max = 8
  174. }
  175. }
  176. }
  177. }
  178. }

§akka-remote

  1. #####################################
  2. # Akka Remote Reference Config File #
  3. #####################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. # comments about akka.actor settings left out where they are already in akka-
  9. # actor.jar, because otherwise they would be repeated in config rendering.
  10.  
  11. akka {
  12.  
  13. actor {
  14.  
  15. serializers {
  16. akka-containers = "akka.remote.serialization.MessageContainerSerializer"
  17. proto = "akka.remote.serialization.ProtobufSerializer"
  18. daemon-create = "akka.remote.serialization.DaemonMsgCreateSerializer"
  19. }
  20.  
  21.  
  22. serialization-bindings {
  23. # Since com.google.protobuf.Message does not extend Serializable but
  24. # GeneratedMessage does, need to use the more specific one here in order
  25. # to avoid ambiguity
  26. "akka.actor.ActorSelectionMessage" = akka-containers
  27. "com.google.protobuf.GeneratedMessage" = proto
  28. "akka.remote.DaemonMsgCreate" = daemon-create
  29. }
  30.  
  31. deployment {
  32.  
  33. default {
  34.  
  35. # if this is set to a valid remote address, the named actor will be
  36. # deployed at that node e.g. "akka.tcp://sys@host:port"
  37. remote = ""
  38.  
  39. target {
  40.  
  41. # A list of hostnames and ports for instantiating the children of a
  42. # router
  43. # The format should be on "akka.tcp://sys@host:port", where:
  44. # - sys is the remote actor system name
  45. # - hostname can be either hostname or IP address the remote actor
  46. # should connect to
  47. # - port should be the port for the remote server on the other node
  48. # The number of actor instances to be spawned is still taken from the
  49. # nr-of-instances setting as for local routers; the instances will be
  50. # distributed round-robin among the given nodes.
  51. nodes = []
  52.  
  53. }
  54. }
  55. }
  56. }
  57.  
  58. remote {
  59.  
  60. ### General settings
  61.  
  62. # Timeout after which the startup of the remoting subsystem is considered
  63. # to be failed. Increase this value if your transport drivers (see the
  64. # enabled-transports section) need longer time to be loaded.
  65. startup-timeout = 10 s
  66.  
  67. # Timout after which the graceful shutdown of the remoting subsystem is
  68. # considered to be failed. After the timeout the remoting system is
  69. # forcefully shut down. Increase this value if your transport drivers
  70. # (see the enabled-transports section) need longer time to stop properly.
  71. shutdown-timeout = 10 s
  72.  
  73. # Before shutting down the drivers, the remoting subsystem attempts to flush
  74. # all pending writes. This setting controls the maximum time the remoting is
  75. # willing to wait before moving on to shut down the drivers.
  76. flush-wait-on-shutdown = 2 s
  77.  
  78. # Reuse inbound connections for outbound messages
  79. use-passive-connections = on
  80.  
  81. # Controls the backoff interval after a refused write is reattempted.
  82. # (Transports may refuse writes if their internal buffer is full)
  83. backoff-interval = 5 ms
  84.  
  85. # Acknowledgment timeout of management commands sent to the transport stack.
  86. command-ack-timeout = 30 s
  87. # The timeout for outbound associations to perform the handshake.
  88. # If the transport is akka.remote.netty.tcp or akka.remote.netty.ssl
  89. # the configured connection-timeout for the transport will be used instead.
  90. handshake-timeout = 15 s
  91.  
  92. # If set to a nonempty string remoting will use the given dispatcher for
  93. # its internal actors otherwise the default dispatcher is used. Please note
  94. # that since remoting can load arbitrary 3rd party drivers (see
  95. # "enabled-transport" and "adapters" entries) it is not guaranteed that
  96. # every module will respect this setting.
  97. use-dispatcher = "akka.remote.default-remote-dispatcher"
  98.  
  99. ### Security settings
  100.  
  101. # Enable untrusted mode for full security of server managed actors, prevents
  102. # system messages to be send by clients, e.g. messages like 'Create',
  103. # 'Suspend', 'Resume', 'Terminate', 'Supervise', 'Link' etc.
  104. untrusted-mode = off
  105. # When 'untrusted-mode=on' inbound actor selections are by default discarded.
  106. # Actors with paths defined in this white list are granted permission to receive actor
  107. # selections messages.
  108. # E.g. trusted-selection-paths = ["/user/receptionist", "/user/namingService"]
  109. trusted-selection-paths = []
  110.  
  111. # Should the remote server require that its peers share the same
  112. # secure-cookie (defined in the 'remote' section)? Secure cookies are passed
  113. # between during the initial handshake. Connections are refused if the initial
  114. # message contains a mismatching cookie or the cookie is missing.
  115. require-cookie = off
  116.  
  117. # Generate your own with the script availbale in
  118. # '$AKKA_HOME/scripts/generate_config_with_secure_cookie.sh' or using
  119. # 'akka.util.Crypt.generateSecureCookie'
  120. secure-cookie = ""
  121.  
  122. ### Logging
  123.  
  124. # If this is "on", Akka will log all inbound messages at DEBUG level,
  125. # if off then they are not logged
  126. log-received-messages = off
  127.  
  128. # If this is "on", Akka will log all outbound messages at DEBUG level,
  129. # if off then they are not logged
  130. log-sent-messages = off
  131.  
  132. # Sets the log granularity level at which Akka logs remoting events. This setting
  133. # can take the values OFF, ERROR, WARNING, INFO, DEBUG, or ON. For compatibility
  134. # reasons the setting "on" will default to "debug" level. Please note that the effective
  135. # logging level is still determined by the global logging level of the actor system:
  136. # for example debug level remoting events will be only logged if the system
  137. # is running with debug level logging.
  138. # Failures to deserialize received messages also fall under this flag.
  139. log-remote-lifecycle-events = on
  140.  
  141. # Logging of message types with payload size in bytes larger than
  142. # this value. Maximum detected size per message type is logged once,
  143. # with an increase threshold of 10%.
  144. # By default this feature is turned off. Activate it by setting the property to
  145. # a value in bytes, such as 1000b. Note that for all messages larger than this
  146. # limit there will be extra performance and scalability cost.
  147. log-frame-size-exceeding = off
  148. # Log warning if the number of messages in the backoff buffer in the endpoint
  149. # writer exceeds this limit. It can be disabled by setting the value to off.
  150. log-buffer-size-exceeding = 50000
  151.  
  152. ### Failure detection and recovery
  153.  
  154. # Settings for the failure detector to monitor connections.
  155. # For TCP it is not important to have fast failure detection, since
  156. # most connection failures are captured by TCP itself.
  157. transport-failure-detector {
  158.  
  159. # FQCN of the failure detector implementation.
  160. # It must implement akka.remote.FailureDetector and have
  161. # a public constructor with a com.typesafe.config.Config and
  162. # akka.actor.EventStream parameter.
  163. implementation-class = "akka.remote.DeadlineFailureDetector"
  164.  
  165. # How often keep-alive heartbeat messages should be sent to each connection.
  166. heartbeat-interval = 4 s
  167.  
  168. # Number of potentially lost/delayed heartbeats that will be
  169. # accepted before considering it to be an anomaly.
  170. # A margin to the `heartbeat-interval` is important to be able to survive sudden,
  171. # occasional, pauses in heartbeat arrivals, due to for example garbage collect or
  172. # network drop.
  173. acceptable-heartbeat-pause = 20 s
  174. }
  175.  
  176. # Settings for the Phi accrual failure detector (http://ddg.jaist.ac.jp/pub/HDY+04.pdf
  177. # [Hayashibara et al]) used for remote death watch.
  178. watch-failure-detector {
  179.  
  180. # FQCN of the failure detector implementation.
  181. # It must implement akka.remote.FailureDetector and have
  182. # a public constructor with a com.typesafe.config.Config and
  183. # akka.actor.EventStream parameter.
  184. implementation-class = "akka.remote.PhiAccrualFailureDetector"
  185.  
  186. # How often keep-alive heartbeat messages should be sent to each connection.
  187. heartbeat-interval = 1 s
  188.  
  189. # Defines the failure detector threshold.
  190. # A low threshold is prone to generate many wrong suspicions but ensures
  191. # a quick detection in the event of a real crash. Conversely, a high
  192. # threshold generates fewer mistakes but needs more time to detect
  193. # actual crashes.
  194. threshold = 10.0
  195.  
  196. # Number of the samples of inter-heartbeat arrival times to adaptively
  197. # calculate the failure timeout for connections.
  198. max-sample-size = 200
  199.  
  200. # Minimum standard deviation to use for the normal distribution in
  201. # AccrualFailureDetector. Too low standard deviation might result in
  202. # too much sensitivity for sudden, but normal, deviations in heartbeat
  203. # inter arrival times.
  204. min-std-deviation = 100 ms
  205.  
  206. # Number of potentially lost/delayed heartbeats that will be
  207. # accepted before considering it to be an anomaly.
  208. # This margin is important to be able to survive sudden, occasional,
  209. # pauses in heartbeat arrivals, due to for example garbage collect or
  210. # network drop.
  211. acceptable-heartbeat-pause = 10 s
  212.  
  213.  
  214. # How often to check for nodes marked as unreachable by the failure
  215. # detector
  216. unreachable-nodes-reaper-interval = 1s
  217.  
  218. # After the heartbeat request has been sent the first failure detection
  219. # will start after this period, even though no heartbeat mesage has
  220. # been received.
  221. expected-response-after = 3 s
  222.  
  223. }
  224.  
  225. # After failed to establish an outbound connection, the remoting will mark the
  226. # address as failed. This configuration option controls how much time should
  227. # be elapsed before reattempting a new connection. While the address is
  228. # gated, all messages sent to the address are delivered to dead-letters.
  229. # Since this setting limits the rate of reconnects setting it to a
  230. # very short interval (i.e. less than a second) may result in a storm of
  231. # reconnect attempts.
  232. retry-gate-closed-for = 5 s
  233.  
  234. # After catastrophic communication failures that result in the loss of system
  235. # messages or after the remote DeathWatch triggers the remote system gets
  236. # quarantined to prevent inconsistent behavior.
  237. # This setting controls how long the Quarantine marker will be kept around
  238. # before being removed to avoid long-term memory leaks.
  239. # WARNING: DO NOT change this to a small value to re-enable communication with
  240. # quarantined nodes. Such feature is not supported and any behavior between
  241. # the affected systems after lifting the quarantine is undefined.
  242. prune-quarantine-marker-after = 5 d
  243.  
  244. # If system messages have been exchanged between two systems (i.e. remote death
  245. # watch or remote deployment has been used) a remote system will be marked as
  246. # quarantined after the two system has no active association, and no
  247. # communication happens during the time configured here.
  248. # The only purpose of this setting is to avoid storing system message redelivery
  249. # data (sequence number state, etc.) for an undefined amount of time leading to long
  250. # term memory leak. Instead, if a system has been gone for this period,
  251. # or more exactly
  252. # - there is no association between the two systems (TCP connection, if TCP transport is used)
  253. # - neither side has been attempting to communicate with the other
  254. # - there are no pending system messages to deliver
  255. # for the amount of time configured here, the remote system will be quarantined and all state
  256. # associated with it will be dropped.
  257. quarantine-after-silence = 5 d
  258.  
  259. # This setting defines the maximum number of unacknowledged system messages
  260. # allowed for a remote system. If this limit is reached the remote system is
  261. # declared to be dead and its UID marked as tainted.
  262. system-message-buffer-size = 20000
  263.  
  264. # This setting defines the maximum idle time after an individual
  265. # acknowledgement for system messages is sent. System message delivery
  266. # is guaranteed by explicit acknowledgement messages. These acks are
  267. # piggybacked on ordinary traffic messages. If no traffic is detected
  268. # during the time period configured here, the remoting will send out
  269. # an individual ack.
  270. system-message-ack-piggyback-timeout = 0.3 s
  271.  
  272. # This setting defines the time after internal management signals
  273. # between actors (used for DeathWatch and supervision) that have not been
  274. # explicitly acknowledged or negatively acknowledged are resent.
  275. # Messages that were negatively acknowledged are always immediately
  276. # resent.
  277. resend-interval = 2 s
  278. # Maximum number of unacknowledged system messages that will be resent
  279. # each 'resend-interval'. If you watch many (> 1000) remote actors you can
  280. # increase this value to for example 600, but a too large limit (e.g. 10000)
  281. # may flood the connection and might cause false failure detection to trigger.
  282. # Test such a configuration by watching all actors at the same time and stop
  283. # all watched actors at the same time.
  284. resend-limit = 200
  285.  
  286. # WARNING: this setting should not be not changed unless all of its consequences
  287. # are properly understood which assumes experience with remoting internals
  288. # or expert advice.
  289. # This setting defines the time after redelivery attempts of internal management
  290. # signals are stopped to a remote system that has been not confirmed to be alive by
  291. # this system before.
  292. initial-system-message-delivery-timeout = 3 m
  293.  
  294. ### Transports and adapters
  295.  
  296. # List of the transport drivers that will be loaded by the remoting.
  297. # A list of fully qualified config paths must be provided where
  298. # the given configuration path contains a transport-class key
  299. # pointing to an implementation class of the Transport interface.
  300. # If multiple transports are provided, the address of the first
  301. # one will be used as a default address.
  302. enabled-transports = ["akka.remote.netty.tcp"]
  303.  
  304. # Transport drivers can be augmented with adapters by adding their
  305. # name to the applied-adapters setting in the configuration of a
  306. # transport. The available adapters should be configured in this
  307. # section by providing a name, and the fully qualified name of
  308. # their corresponding implementation. The class given here
  309. # must implement akka.akka.remote.transport.TransportAdapterProvider
  310. # and have public constructor without parameters.
  311. adapters {
  312. gremlin = "akka.remote.transport.FailureInjectorProvider"
  313. trttl = "akka.remote.transport.ThrottlerProvider"
  314. }
  315.  
  316. ### Default configuration for the Netty based transport drivers
  317.  
  318. netty.tcp {
  319. # The class given here must implement the akka.remote.transport.Transport
  320. # interface and offer a public constructor which takes two arguments:
  321. # 1) akka.actor.ExtendedActorSystem
  322. # 2) com.typesafe.config.Config
  323. transport-class = "akka.remote.transport.netty.NettyTransport"
  324.  
  325. # Transport drivers can be augmented with adapters by adding their
  326. # name to the applied-adapters list. The last adapter in the
  327. # list is the adapter immediately above the driver, while
  328. # the first one is the top of the stack below the standard
  329. # Akka protocol
  330. applied-adapters = []
  331.  
  332. transport-protocol = tcp
  333.  
  334. # The default remote server port clients should connect to.
  335. # Default is 2552 (AKKA), use 0 if you want a random available port
  336. # This port needs to be unique for each actor system on the same machine.
  337. port = 2552
  338.  
  339. # The hostname or ip to bind the remoting to,
  340. # InetAddress.getLocalHost.getHostAddress is used if empty
  341. hostname = ""
  342.  
  343. # Enables SSL support on this transport
  344. enable-ssl = false
  345.  
  346. # Sets the connectTimeoutMillis of all outbound connections,
  347. # i.e. how long a connect may take until it is timed out
  348. connection-timeout = 15 s
  349.  
  350. # If set to "<id.of.dispatcher>" then the specified dispatcher
  351. # will be used to accept inbound connections, and perform IO. If "" then
  352. # dedicated threads will be used.
  353. # Please note that the Netty driver only uses this configuration and does
  354. # not read the "akka.remote.use-dispatcher" entry. Instead it has to be
  355. # configured manually to point to the same dispatcher if needed.
  356. use-dispatcher-for-io = ""
  357.  
  358. # Sets the high water mark for the in and outbound sockets,
  359. # set to 0b for platform default
  360. write-buffer-high-water-mark = 0b
  361.  
  362. # Sets the low water mark for the in and outbound sockets,
  363. # set to 0b for platform default
  364. write-buffer-low-water-mark = 0b
  365.  
  366. # Sets the send buffer size of the Sockets,
  367. # set to 0b for platform default
  368. send-buffer-size = 256000b
  369.  
  370. # Sets the receive buffer size of the Sockets,
  371. # set to 0b for platform default
  372. receive-buffer-size = 256000b
  373.  
  374. # Maximum message size the transport will accept, but at least
  375. # 32000 bytes.
  376. # Please note that UDP does not support arbitrary large datagrams,
  377. # so this setting has to be chosen carefully when using UDP.
  378. # Both send-buffer-size and receive-buffer-size settings has to
  379. # be adjusted to be able to buffer messages of maximum size.
  380. maximum-frame-size = 128000b
  381.  
  382. # Sets the size of the connection backlog
  383. backlog = 4096
  384.  
  385. # Enables the TCP_NODELAY flag, i.e. disables Nagle’s algorithm
  386. tcp-nodelay = on
  387.  
  388. # Enables TCP Keepalive, subject to the O/S kernel’s configuration
  389. tcp-keepalive = on
  390.  
  391. # Enables SO_REUSEADDR, which determines when an ActorSystem can open
  392. # the specified listen port (the meaning differs between *nix and Windows)
  393. # Valid values are "on", "off" and "off-for-windows"
  394. # due to the following Windows bug: http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4476378
  395. # "off-for-windows" of course means that it's "on" for all other platforms
  396. tcp-reuse-addr = off-for-windows
  397.  
  398. # Used to configure the number of I/O worker threads on server sockets
  399. server-socket-worker-pool {
  400. # Min number of threads to cap factor-based number to
  401. pool-size-min = 2
  402.  
  403. # The pool size factor is used to determine thread pool size
  404. # using the following formula: ceil(available processors * factor).
  405. # Resulting size is then bounded by the pool-size-min and
  406. # pool-size-max values.
  407. pool-size-factor = 1.0
  408.  
  409. # Max number of threads to cap factor-based number to
  410. pool-size-max = 2
  411. }
  412.  
  413. # Used to configure the number of I/O worker threads on client sockets
  414. client-socket-worker-pool {
  415. # Min number of threads to cap factor-based number to
  416. pool-size-min = 2
  417.  
  418. # The pool size factor is used to determine thread pool size
  419. # using the following formula: ceil(available processors * factor).
  420. # Resulting size is then bounded by the pool-size-min and
  421. # pool-size-max values.
  422. pool-size-factor = 1.0
  423.  
  424. # Max number of threads to cap factor-based number to
  425. pool-size-max = 2
  426. }
  427.  
  428.  
  429. }
  430.  
  431. netty.udp = ${akka.remote.netty.tcp}
  432. netty.udp {
  433. transport-protocol = udp
  434. }
  435.  
  436. netty.ssl = ${akka.remote.netty.tcp}
  437. netty.ssl = {
  438. # Enable SSL/TLS encryption.
  439. # This must be enabled on both the client and server to work.
  440. enable-ssl = true
  441.  
  442. security {
  443. # This is the Java Key Store used by the server connection
  444. key-store = "keystore"
  445.  
  446. # This password is used for decrypting the key store
  447. key-store-password = "changeme"
  448.  
  449. # This password is used for decrypting the key
  450. key-password = "changeme"
  451.  
  452. # This is the Java Key Store used by the client connection
  453. trust-store = "truststore"
  454.  
  455. # This password is used for decrypting the trust store
  456. trust-store-password = "changeme"
  457.  
  458. # Protocol to use for SSL encryption, choose from:
  459. # Java 6 & 7:
  460. # 'SSLv3', 'TLSv1'
  461. # Java 7:
  462. # 'TLSv1.1', 'TLSv1.2'
  463. protocol = "TLSv1"
  464.  
  465. # Example: ["TLS_RSA_WITH_AES_128_CBC_SHA", "TLS_RSA_WITH_AES_256_CBC_SHA"]
  466. # You need to install the JCE Unlimited Strength Jurisdiction Policy
  467. # Files to use AES 256.
  468. # More info here:
  469. # http://docs.oracle.com/javase/7/docs/technotes/guides/security/SunProviders.html#SunJCEProvider
  470. enabled-algorithms = ["TLS_RSA_WITH_AES_128_CBC_SHA"]
  471.  
  472. # There are three options, in increasing order of security:
  473. # "" or SecureRandom => (default)
  474. # "SHA1PRNG" => Can be slow because of blocking issues on Linux
  475. # "AES128CounterSecureRNG" => fastest startup and based on AES encryption
  476. # algorithm
  477. # "AES256CounterSecureRNG"
  478. # The following use one of 3 possible seed sources, depending on
  479. # availability: /dev/random, random.org and SecureRandom (provided by Java)
  480. # "AES128CounterInetRNG"
  481. # "AES256CounterInetRNG" (Install JCE Unlimited Strength Jurisdiction
  482. # Policy Files first)
  483. # Setting a value here may require you to supply the appropriate cipher
  484. # suite (see enabled-algorithms section above)
  485. random-number-generator = ""
  486. }
  487. }
  488.  
  489. ### Default configuration for the failure injector transport adapter
  490.  
  491. gremlin {
  492. # Enable debug logging of the failure injector transport adapter
  493. debug = off
  494. }
  495.  
  496. ### Default dispatcher for the remoting subsystem
  497.  
  498. default-remote-dispatcher {
  499. type = Dispatcher
  500. executor = "fork-join-executor"
  501. fork-join-executor {
  502. # Min number of threads to cap factor-based parallelism number to
  503. parallelism-min = 2
  504. parallelism-max = 2
  505. }
  506. }
  507. backoff-remote-dispatcher {
  508. type = Dispatcher
  509. executor = "fork-join-executor"
  510. fork-join-executor {
  511. # Min number of threads to cap factor-based parallelism number to
  512. parallelism-min = 2
  513. parallelism-max = 2
  514. }
  515. }
  516.  
  517.  
  518. }
  519.  
  520. }

§akka-testkit

  1. ######################################
  2. # Akka Testkit Reference Config File #
  3. ######################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9. test {
  10. # factor by which to scale timeouts during tests, e.g. to account for shared
  11. # build system load
  12. timefactor = 1.0
  13.  
  14. # duration of EventFilter.intercept waits after the block is finished until
  15. # all required messages are received
  16. filter-leeway = 3s
  17.  
  18. # duration to wait in expectMsg and friends outside of within() block
  19. # by default
  20. single-expect-default = 3s
  21.  
  22. # The timeout that is added as an implicit by DefaultTimeout trait
  23. default-timeout = 5s
  24.  
  25. calling-thread-dispatcher {
  26. type = akka.testkit.CallingThreadDispatcherConfigurator
  27. }
  28. }
  29. }

§akka-zeromq

  1. #####################################
  2. # Akka ZeroMQ Reference Config File #
  3. #####################################
  4.  
  5. # This is the reference config file that contains all the default settings.
  6. # Make your edits/overrides in your application.conf.
  7.  
  8. akka {
  9.  
  10. zeromq {
  11.  
  12. # The default timeout for a poll on the actual zeromq socket.
  13. poll-timeout = 100ms
  14.  
  15. # Timeout for creating a new socket
  16. new-socket-timeout = 5s
  17.  
  18. socket-dispatcher {
  19. # A zeromq socket needs to be pinned to the thread that created it.
  20. # Changing this value results in weird errors and race conditions within
  21. # zeromq
  22. executor = thread-pool-executor
  23. type = "PinnedDispatcher"
  24. thread-pool-executor.allow-core-timeout = off
  25. }
  26. }
  27. }