typesafehub / conductr-lib

Other
8 stars 13 forks source link

Make the usage of system names consistent #143

Closed huntc closed 7 years ago

huntc commented 7 years ago

This commit provides the ability to build a system name from Env vars when using the Akka APIs. We want to encourage users to use our API to build a system name, allowing them to fall back to a name of their choice when not using ConductR. Not using our API can result in making mistakes around using a system name that does not correspond to seed nodes, particularly when using Akka cluster.

I preserve backwards compatibility while deprecating the previous Env.asConfig API in order to encourage users to use the new API.

I also removed some 2.12 deprecations.

In addition to addressing the unit tests, I've tested the new library against the Akka cluster sample from the Akka team. Establishing an actor system is now cleaner and less error prone:

val systemName = Env.mkSystemName("ClusterSystem")
val config = Env.asConfig(systemName)
implicit val system = ActorSystem(systemName, config.withFallback(ConfigFactory.load()))

I've observed that I can still create an Akka cluster bundle and have it work on ConductR across 2 nodes.

typesafe-tools commented 7 years ago

Improve the experience for creating an Akka cluster based service that is suitable for ConductR