dependabot-preview[bot] on nuget
dependabot-preview[bot] on dev
Bump MongoDB.Driver from 2.9.1 … (compare)
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);
}
}