stew
stew

Reputation: 11366

detecting failure from remote nodes from an akka router

Lets say I have a router which is configured to create actors on multiple remote nodes. Perhaps I have a configuration like this:

akka {
        actor {
            deployment {
                 /fooRouter {
                router = round-robin
                resizer {
                    lower-bound = 2
                    upper-bound = 10
                }
                target {
                    nodes = ["akka://[email protected]:2555", "akka://[email protected]:2555"]
                }
            }
        }
    }

If we pretend that one of these nodes, 10.0.1.1, for some reason, has lost connectivity to the database server, so all messages passed to it will result in failure. Is there some way that the router could come to know that the 10.0.1.1 node as effectively useless and stop using it?

Upvotes: 3

Views: 493

Answers (1)

Roland Kuhn
Roland Kuhn

Reputation: 15472

No, currently there is not. You can have the actors on the failed node commit suicide, but as soon as the resizer starts new ones, they will reappear. Even with clustering support—which is yet to come—this would not be automatic, because connections to some external resource are not part of the cluster’s reachability metric. This means that you would have to write code which takes that node down explicitly, upon which the actors could be migrated to some other node (details are not yet fully fleshed out).

So, currently you would have to write your own router as a real actor, which takes reachability into account.

Upvotes: 2

Related Questions