Handle FromConfig in withFallback also, see #944

This commit is contained in:
Patrik Nordwall 2012-09-17 09:39:35 +02:00
parent 08dbc4d235
commit d59612609f
2 changed files with 2 additions and 1 deletions

View file

@ -51,7 +51,7 @@ class ConsistentHashingRouterSpec extends AkkaSpec(ConsistentHashingRouterSpec.c
import akka.routing.ConsistentHashingRouterSpec._
implicit val ec = system.dispatcher
val router1 = system.actorOf(Props[Echo].withRouter(ConsistentHashingRouter()), "router1")
val router1 = system.actorOf(Props[Echo].withRouter(FromConfig()), "router1")
"consistent hashing router" must {
"create routees from configuration" in {

View file

@ -199,6 +199,7 @@ case class ConsistentHashingRouter(
* that can't be defined in configuration.
*/
override def withFallback(other: RouterConfig): RouterConfig = other match {
case fromConfig: FromConfig this
case otherRouter: ConsistentHashingRouter
val useResizer =
if (this.resizer.isEmpty && otherRouter.resizer.isDefined) otherRouter.resizer