* Split config reference to one for each module/extension. * Adjusted signature of registerExtension to avoid race of extension init * Moved Duration.dilated to testkit * TestKitExtension * RemoteExtension * SerializationExtension * Durable mailboxes extensions * Fixed broken serialization bindings and added test * Updated configuration documentation * System properties akka.remote.hostname akka.remote.port replaced with akka.remote.server.hostname and akka.remote.server.port * Adjustments of ActorSystem initialization. Still don't like the two-phase constructor/init flow. Very fragile for changes. Review fixes. SerializationExtension
32 lines
722 B
Scala
32 lines
722 B
Scala
package akka.docs.config
|
|
|
|
import org.scalatest.WordSpec
|
|
import org.scalatest.matchers.MustMatchers
|
|
|
|
//#imports
|
|
import akka.actor.ActorSystem
|
|
import com.typesafe.config.ConfigFactory
|
|
import com.typesafe.config.ConfigParseOptions
|
|
|
|
//#imports
|
|
|
|
class ConfigDocSpec extends WordSpec {
|
|
|
|
"programmatically configure ActorSystem" in {
|
|
//#custom-config
|
|
val customConf = ConfigFactory.parseString("""
|
|
akka.actor.deployment {
|
|
/app/my-service {
|
|
router = round-robin
|
|
nr-of-instances = 3
|
|
}
|
|
}
|
|
""", ConfigParseOptions.defaults)
|
|
val system = ActorSystem("MySystem", ConfigFactory.systemProperties.withFallback(customConf))
|
|
//#custom-config
|
|
|
|
system.stop()
|
|
|
|
}
|
|
|
|
}
|