4

I learned from the Akka.net WebCrawler and created my own cluster test. I have a Processor node(Console App) and an API node(SignalR). Here are the configurations.

Processor node:

akka {
    actor{
        provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
        deployment {
            /dispatcher/signalR {
                router = broadcast-group
                routees.paths = ["/user/signalr"]
                cluster {
                    enabled = on
                    #max-nr-of-instances-per-node = 1
                    allow-local-routees = false
                    use-role = api
                }
            }
        }
    }
    remote {
        log-remote-lifecycle-events = DEBUG
        helios.tcp {
                port = 0
                hostname = 127.0.0.1
        }
    }
    cluster {
        seed-nodes = ["akka.tcp://stopfinder@127.0.0.1:4545"]
        roles = [processor]
    }
}

API node: (Non seed-node will have port = 0)

akka {
    actor{
        provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
    }
    remote {
        log-remote-lifecycle-events = DEBUG
        helios.tcp {
                port = 4545
                hostname = 127.0.0.1
        }
    }
    cluster {
        seed-nodes = ["akka.tcp://stopfinder@127.0.0.1:4545"]
        roles = [api]
    }
}

Inside of the API node, I created a normal actor called SignalR.

Inside of the processor node I created a normal actor and used the Scheduler to Tell() the API node's signalR actor some string.

This works great when I have one Processor and one API. It also works when I have multiple Processor nodes and a single API node. Unfortunately, when I have multiple API node, no matter how I setup the configuration, the "tell" won't tell all of the API nodes; the message only goes to one of them. Which node receives the message is based on the API node start sequence. It seems that I have the all API nodes registered in the cluster correctly, but I could be wrong.

I'm starting to feel that this is a configuration or understanding issue. Can anyone share any insights?

I did some additional testing. The behavior remains the same when I replace the ASP.NET SignalR API node with a normal console application.

UPDATE: I contacted Akka.NET team. This behavior is a known bug. It will be fixed in 1.1 release. UPDATE 2: The issue has been marked as fixed for the proejct on GitHub.

Morio
  • 8,463
  • 5
  • 25
  • 29
  • Hmm...at first glance I can't find anything wrong with your HOCON config. What version of Akka.Cluster are you using? Lots of remoting and cluster bugs have been fixed in the time since those samples were made, and the Akka.Cluster version is especially important to answer this question. I'de recommend installing the latest pre-release of Akka.Cluster on NuGet - version 1.0.6.17-beta: open the package manager, tick the "Include prerelase" checkbox and search for `Akka.Cluster`. If this still fails to solve the problem, it might be a bug and is best to open an issue on Github. – easuter Feb 11 '16 at 14:36
  • Actually, your config does appear to have a problem: you're starting several API nodes but they're all competing for the the same port and trying to set themselves up as the same seed if they're all configured to run on port 4545. – easuter Feb 11 '16 at 15:00
  • @easuter Thank you remind me of the port issue and reproducing the problem. In short, I contacted Akka.NET team, this is a known bug. – Morio Feb 11 '16 at 19:05

0 Answers0