Aaronontheweb on dev
Fix #4083 - Endpoint receive bu… (compare)
Aaronontheweb on dev
Convert to ImmutableHashSet for… (compare)
I have managed to get routing + cluster + remote deployment working fine. But I need to extend it so that my cluster also has access to a cluster.. When I do this i'm getting the following exception
Configuration missing for router [akka://Bifrost/remote/akka.tcp/Bifrost@192.168.0.121:56945/user/processor/c1/geocode] in 'akka.actor.deployment' section.
The GeocodeActor
cluster is created within ProcessorActor
so the path looks correct, but I'm not sure why its complaining as my config looks like this:
actor {
provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
ask-timeout = 30s
deployment {
/processor {
router = smallest-mailbox-pool
routees.paths = ["/user/processor"]
nr-of-instances = 50
cluster {
enabled = on
max-nr-of-instances-per-node = 50 # want less than this in production to ensure it spans multiple nodes
allow-local-routees = off
use-role = processor
}
}
"/processor/*/geocode" {
router = smallest-mailbox-pool
nr-of-instances = 50
cluster {
enabled = on
max-nr-of-instances-per-node = 50 # want less than this in production to ensure it spans multiple nodes
allow-local-routees = off
use-role = geocode
}
}
}
}
Can anyone help? Thanks in advance
The actor will be suspended until the task returned by handler completes.
is the line that caught my eye in the async comment
ActorOf
for that router.
lol ok sorry... let me rephrase. If you look up a little youll see my initial question.
I have a test client that contains all code. It contains the HOCON mentioned above. At first it creates a ProcessActor which is defines as a clustered pool. This is remotely deployed onto a node which defines its roles as [process, geocode]. The Process actor (running on the node) then attempts to create its own clustered pool for geocodes, which just happens to be deployed to itself at the moment. Its this bit that doesnt work properly. The config for the geocode is on TestClient (I was attempting to copy how webcrawler defined this)
Right.. ok that works, thanks... Perhaps I am over complicating things? What would be the recommended way of doing things.
If I create a bunch of ProcessActors to process inbound messages. Would you expect them to create one actor each to work with. Or (in my case at the moment) each ProcessActor defines a pooled cluster of [geocode] to use which, I agree, is more complicated
That sounds reasonable, how can I do that? Currently within my processor I create the geocode actor pool like so
this.GeocodeActor = ReceiveActor.Context.ActorOf(Props.Create<GeocodeActor>().WithRouter(FromConfig.Instance), "geocode");
Which (thanks to your help) I now know is taken from the node that the Processor is running on, not the test client. Would I be able to define them both in the test client but just let them know about each other?
I don't like routers, 'cause they introduce too much "magic". If they were fully verified at compile-time, this wouldn't be much of an issue, but as everything is driven by HOCON config at runtime, it's easy to get hard to debug runtime errors.
Regarding ways to communicate:
public static class ConfigExtensions
{
public static Config ExtractAkkaConfig(this IConfiguration section, dynamic configSection = null)
{
if (configSection == null)
{
configSection = new ExpandoObject();
}
var expandoDict = configSection as IDictionary<string, object>;
var configurationSections = section.GetChildren().ToList();
foreach (var configurationSection in configurationSections)
{
if (configurationSection.Value != null)
{
expandoDict.Add(configurationSection.Key, configurationSection.Value);
}
else
{
var exp = new ExpandoObject();
expandoDict.Add(configurationSection.Key, exp);
ExtractAkkaConfig(configurationSection, expandoDict[configurationSection.Key]);
}
}
var configJson = "{ akka: " + JsonConvert.SerializeObject(configSection) + " }";
return ConfigurationFactory.ParseString(configJson);
}
}