Overriding multiple config values in Typesafe config when using an uberjar to deploy

前端 未结 3 897
广开言路
广开言路 2020-12-14 03:32

I\'ve an Akka application which uses multiple configuration values (IP address, port numbers) defined in resource/application.conf. I\'m using the sbt-ass

3条回答
  •  鱼传尺愫
    2020-12-14 04:14

    I was able to programmatically override default akka config with:

    val customConf =
          ConfigFactory.parseString(s"""
                akka {
                  persistence.snapshot-store.local{
                    dir = target/snapshot
                  }
                  persistence.journal.leveldb.dir = target/journal
                }
            """)
    val config = customConf.withFallback(original).resolve()    
    logger.info(config.root().render())
    val system = ActorSystem("iSystem", config)
    

提交回复
热议问题