1 回答

TA贡献1829条经验 获得超6个赞
创建configLocal对象时,您可以使用ConfigFactory.load()从文件中加载配置。
final Config configLocal = ConfigFactory.parseString("akka.cluster.roles = [masterRole] ").
// withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.port=0" )).
withFallback(ConfigFactory.parseString("akka.remote.netty.tcp.hostname = \"127.0.0.1\"")).
//withFallback(ConfigFactory.parseString("akka.cluster.role.workerRole.min-nr-of-members = " +nbWorkers)).
withFallback(ConfigFactory.parseString("akka.cluster.seed-nodes = [\"akka.tcp://MasterMain@127.0.0.1:2552\"]")).
withFallback(ConfigFactory.load());
添加回答
举报