Akka 默认与运行时配置
Akka default vs runtime configuration
我阅读了 Akka v2.3.11 文档(Java、而非 Scala),但对配置的工作原理仍然有些困惑。在第 2.9.2 节(“Akka 和 JAR 捆绑”)中指出:
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.
对于 Akka 和演员来说是全新的,但作为 Java 开发人员已经 10 多年了,我 从未 见过 reference.conf
文件在任何 JAR 中。那么 Akka 在这里谈论的是什么?他们是否在暗示如果我的 Akka 项目使用 Guice 和 Guava,我需要为每个定义 reference.conf
文件?!?
此外,有人可以证实我对 application.conf
与 reference.conf
的理解吗?我的 理解 是您应该定义一个包含默认 Akka 配置的 reference.conf
,然后还定义一个覆盖它的 application.conf
?如果那是真的,为什么首先要使用 reference.conf
?为什么不直接使用 application.conf
?我很困惑。
Akka 使用类型安全的配置库,请查看解释 reference.conf
和 application.conf
之间区别的文档 https://github.com/typesafehub/config/blob/master/README.md。
基本上reference.conf
Akka库自带,用户不应该碰它(但可以作为参考)除非将多个使用类型安全配置库的jar(不是必需的akka jar)合并到一个jar中。
我阅读了 Akka v2.3.11 文档(Java、而非 Scala),但对配置的工作原理仍然有些困惑。在第 2.9.2 节(“Akka 和 JAR 捆绑”)中指出:
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.
对于 Akka 和演员来说是全新的,但作为 Java 开发人员已经 10 多年了,我 从未 见过 reference.conf
文件在任何 JAR 中。那么 Akka 在这里谈论的是什么?他们是否在暗示如果我的 Akka 项目使用 Guice 和 Guava,我需要为每个定义 reference.conf
文件?!?
此外,有人可以证实我对 application.conf
与 reference.conf
的理解吗?我的 理解 是您应该定义一个包含默认 Akka 配置的 reference.conf
,然后还定义一个覆盖它的 application.conf
?如果那是真的,为什么首先要使用 reference.conf
?为什么不直接使用 application.conf
?我很困惑。
Akka 使用类型安全的配置库,请查看解释 reference.conf
和 application.conf
之间区别的文档 https://github.com/typesafehub/config/blob/master/README.md。
基本上reference.conf
Akka库自带,用户不应该碰它(但可以作为参考)除非将多个使用类型安全配置库的jar(不是必需的akka jar)合并到一个jar中。