配置

你开始使用Akka时可以不需要定义任何配置,因为Akka提供了合理的默认值。不过为了适应特定的运行环境,你可能需要修改设置来更改默认行为。可以修改的典型设置的例子:

  • 日志级别和后端记录器
  • 启用远程
  • 消息序列化
  • 路由器定义
  • 调度的调整

Akka使用Typesafe配置库,它同样也是你自己的应用或库的不错选择,不管你用不用Akka。这个库由Java实现,没有外部的依赖;本文后面将只对这个库有一些归纳,你应该查看其文档参考具体的使用(尤其是ConfigFactory)。

警告

如果你在Scala REPL的2.9.x系列版本中使用Akka,并且你不提供自己的ClassLoader给ActorSystem,则需要以“-Yrepl-sync”选项启动REPL来解决上下文ClassLoader的缺陷。

配置读取的地方

Akka的所有配置都保存在ActorSystem的实例中,或者换一种说法,从外界来看,ActorSystem是配置信息的唯一消费者。在构造一个actor系统时,你可以选择传进一个Config对象,如果不传则等效于传入ConfigFactory.load()(通过正确的类加载器)。粗略的讲,这意味着默认会解析classpath根目录下所有的application.confapplication.jsonapplication.properties文件——请参考前面提到的文档以获取细节。然后actor系统会合并classpath根目录下的所有 reference.conf行成后备配置,也就是说,它在内部使用

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

其哲学是代码永远不包含缺省值,相反是依赖于随库提供的 reference.conf 中的配置。

系统属性中覆盖的配置具有最高优先级,参见HOCON 规范(靠近末尾的位置)。此外值得注意的是,应用程序配置——缺省为application——可以使用config.resource属性重写 (还有更多,请参阅配置文档)。

注意

如果你正在编写一个Akka 应用,将你的配置保存类路径的根目录下的application.conf文件中。如果你正在编写一个基于Akka的库,将其配置保存在JAR包根目录下的reference.conf文件中。

当使用JarJar,,OneJar,Assembly或任何jar打包命令(jar-bundler)

警告

Akka的配置方法重度依赖于这个理念——每一模块/jar都有它自己的 reference.conf文件,所有这些都将会被配置发现并加载。不幸的是,这也意味着如果你放置/合并多个jar到相同的 jar中,你也需要合并所有的reference.conf文件。否则所有的默认设置将会丢失,Akka将无法工作。

如果你使用 Maven 打包应用程序,你还可以使用Apache Maven Shade Plugin中对资源转换(Resource
Transformers)
的支持,来将所有构建类路径中的reference.conf合并为一个文件。

插件配置可能如下所示:

  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>

自定义application.conf

一个自定义的application.conf可能看起来像这样:

  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. akka {
  4. # Loggers to register at boot time (akka.event.Logging$DefaultLogger logs
  5. # to STDOUT)
  6. loggers = ["akka.event.slf4j.Slf4jLogger"]
  7. # Log level used by the configured loggers (see "loggers") as soon
  8. # as they have been started; before that, see "stdout-loglevel"
  9. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  10. loglevel = "DEBUG"
  11. # Log level for the very basic logger activated during ActorSystem startup.
  12. # This logger prints the log messages to stdout (System.out).
  13. # Options: OFF, ERROR, WARNING, INFO, DEBUG
  14. stdout-loglevel = "DEBUG"
  15. actor {
  16. provider = "akka.cluster.ClusterActorRefProvider"
  17. default-dispatcher {
  18. # Throughput for default Dispatcher, set to 1 for as fair as possible
  19. throughput = 10
  20. }
  21. }
  22. remote {
  23. # The port clients should connect to. Default is 2552.
  24. netty.tcp.port = 4711
  25. }
  26. }

包含文件" class="reference-link">包含文件

有时包含另一个配置文件内容的能力是非常有用的,例如假设你有一个application.conf包含所有环境独立设置,然后使用特定环境的设置覆写。

-Dconfig.resource=/dev.conf制定系统属性,将会加载dev.conf文件,并包含application.conf

dev.conf:

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

更高级的包括和替换机制的解释在HOCON规范中。

配置日志

如果系统或配置属性akka.log-config-on-start 被设置为 on,则在actor系统启动的时候,就完成了INFO级别的日志设置。当你不能确定使用何种配置时,这很有用。

如果有疑问,你也可以在创建actor系统之前或之后,很容易很方便地检查配置对象:

  1. Welcome to Scala version @scalaVersion@ (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. scala> import com.typesafe.config._
  5. import com.typesafe.config._
  6. scala> ConfigFactory.parseString("a.b=12")
  7. res0: com.typesafe.config.Config = Config(SimpleConfigObject({"a" : {"b" : 12}}))
  8. scala> res0.root.render
  9. res1: java.lang.String =
  10. {
  11. # String: 1
  12. "a" : {
  13. # String: 1
  14. "b" : 12
  15. }
  16. }

展示结果中,每个项目前会有评论展示这个配置的起源(对应的文件和行数),并展示已存在的评论,如配置参考中的。actor系统合并参考并解析后形成的设置,可以这样显示:

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

谈一谈类加载器

在配置文件的几个地方,可以通过制定类的全名来让Akka实例化该类。这是通过Java反射完成的,相应地用到了一个ClassLoader。在具有挑战性的环境中,如应用容器和OSGi绑定中,选择正确的类加载器并不总是一件简单的事情,Akka的现行做法是每个 ActorSystem 实现存储当前线程的上下文类加载器(如果可用,否则就使用他自己的加载器this.getClass.getClassLoader),并使用它为所有的反射访问服务。这意味着Akka放在引导类路径(boot class path)下,会从奇怪的地方产生NullPointerException: 这里就是不支持。

应用特定设置

配置也可用于应用程序特定的设置。一个好的实践是将这些设置放在一个扩展中,像下面的章节所描述的:

配置多个ActorSystem

如果你有一个以上的ActorSystem(或你正在写一个库,有可能有一个独立于应用的 ActorSystem) 你可能想要为每个系统进行单独配置。

由于 ConfigFactory.load() 会合并classpath中所有匹配名称的资源, 最简单的方式是利用这一功能并在配置树中区分actor系统:

  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))

这两个例子演示了“提升子树”技巧的不同变种: 第一种情况下,actor系统获得的配置是

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

而在第二种情况下,只有 “akka” 子树被提升了,结果如下:

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

注意

这个配置文件库非常强大,这里不可能解释其所有的功能。特别是如何在配置文件中包含其它的配置文件 (在包含文件Including files中有一个简单的例子) 以及通过路径替换来复制部分配置树。

你也可以在初始化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))

从自定义位置读取配置

你可以使用代码或系统属性,来替换或补充application.conf

如果你使用的方法是ConfigFactory.load()(Akka默认方式),你可以通过定义-Dconfig.resource=whatever-Dconfig.file=whatever
-Dconfig.url=whatever替换 application.conf

-Dconfig.resource和相关选项指定的替换配置文件中,如果你还想使用application.{conf,json,properties},可以使用include "application"。在include "application"之前指定的设置会被包含进来的文件内容重写,同理所包含文件的内容也会被之后的内容重写。

在代码中,有很多自定义选项。

ConfigFactory.load()有几个重载;这些重载允许你指定夹在 系统属性(重写)和默认值(来自reference.conf)之间的配置,并替换通常的application.{conf,json,properties}-Dconfig.file相关选项。

ConfigFactory.load() 最简单的变体需要资源基本名称(application之外的);如myname.confmyname.jsonmyname.properties而不是application.{conf,json,properties}

最灵活的变体是以一个Config对象为参数,你可以使用ConfigFactory中的任何方法加载。例如,你可以在代码中使用ConfigFactory.parseString()处理一个配置字符串,或者你可以使用ConfigFactory.parseMap()创建一个映射,或者也可以加载一个文件。

你也可以将自定义的配置与通常的配置组合起来,像这样:

  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);

使用Config对象时,请牢记这个蛋糕有三”层”:

  • ConfigFactory.defaultOverrides()(系统属性)
  • 应用设置
  • ConfigFactory.defaultReference()(reference.conf)

正常的目标是要自定义中间一层,不管其他两个。

  • ConfigFactory.load()加载整个堆栈
  • ConfigFactory.load()的重载允许你指定一个不同的中间层
  • ConfigFactory.parse()变体加载单个文件或资源

要叠加两层,可使用override.withFallback(fallback);请努力保持系统属性(defaultOverrides())在顶部,reference.confdefaultReference())在底部。

要记住,通常你只需要在application.conf添加一个include语句,而不是编写代码。在application.conf顶部引入的将被application.conf其余部分覆盖,而那些在底部的设置将覆盖以前的内容。

Actor部署配置

可以在配置的akka.actor.deployment节中定义特定actor的部署设置。在部署部分有可能定义这些事物——调度器、邮箱、路由器设置和远程部署。在相应主题的章节中详细介绍了配置的这些特性。一个例子,可以如下所示:

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

一个指定actor部署部分的设置是通过其相对 /user的路径来标识的。

你可以使用星号作为通配符匹配actor的路径部分,所以你可以指定:/*/sampleActor将匹配该树形结构中那个级别上的所有sampleActor。你也能把通配符放在最后来匹配某一级别的所有actor:/someParent/*。非通配符匹配总是有更高的优先级,所以:/foo/bar/foo/* 更具体,并且只有最高优先的匹配才会被使用。请注意它不能用于部分匹配,像这样:/foo*/bar/f*o/bar 等。

参考配置清单

每个Akka模块都有保存默认值的“reference”配置文件。

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

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

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

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

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

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

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

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

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