akka.net

Why do I get a DeathWatchNotification of an undelivered message on shutdown?

旧时模样 提交于 2019-12-25 11:57:04
问题 Why do a get a DeathWatchNotification when running this console app: class Program { private static ActorSystem TestSystem; static void Main(string[] args) { TestSystem = ActorSystem.Create("TestSystem"); TestSystem.ActorOf<TestActor>("Test"); Console.WriteLine("Press a key to shutdown actor system"); Console.ReadKey(); TestSystem.Shutdown(); TestSystem.AwaitTermination(); Console.WriteLine("Press a key to quit"); Console.ReadKey(); } } public class TestActor : ReceiveActor { public TestActor

How can I have an actor running on one process send a message to another actor running on a separate process?

[亡魂溺海] 提交于 2019-12-23 23:13:11
问题 I want to have actors running on various processes (or nodes) send messages to other actors running off of different processes (or nodes), all while maintaining fault-tolerance and load balancing. I am currently attempting to use Akka.Cluster's Sharding feature to accomplish this. However, I am not sure how to accomplish this... I have the following code that reflects my seed node: let configurePort port = let config = Configuration.parse (""" akka { actor { provider = "Akka.Cluster

Akka.net asp.net 5 mvc 6 configuration for Hocon

假装没事ソ 提交于 2019-12-13 16:12:47
问题 I am currently trying to use akka.net but the configuration they use HOCON is a different syntax from the json syntax normally used in app.json when configuring our app. Does anyone know how to use HOCON with the current app.json configuration? 回答1: I use ConfigurationFactory.FromObject and some classes that has the properties that I'm interested in to read the akka-config from appsettings. var config = ConfigurationFactory.FromObject(new { akka = configuration.GetSection("Akka").Get

Node doesn't rejoin cluster after being downed

僤鯓⒐⒋嵵緔 提交于 2019-12-13 15:45:54
问题 I'm using Akka.NET's cluster (1.0.5) functionality to implement a service that consists of a master node that receives requests over HTTP and farms the work out to worker nodes that have joined the cluster. The idea is to be able to easily accomplish the following: add worker nodes to cluster when demand is high (check) be able to reboot the master node or take it offline (maintentance/misbehaviour/whatever) and have the workers reconnect when it becomes available (check) upgrade/reboot a

Testing Akka.NET's Context.Parent with TestKit

谁都会走 提交于 2019-12-13 14:07:09
问题 I have an actor that responds to a message by sending a message to it's parent, like this... public void Handle(string message) { Context.Parent.Tell("Hello"); } I now want to test that the message is sent to the Actors Parent, but can't figure out how. My current test looks like the following... pubilc void AllResponsesWillGoToParent() { ActorOf<MyActor>().Tell("Respond to parent"); ExpectMsg<string>(x => x == "Hello"); } This of course doesn't work because the actors parent is the test

What is the correct way to resolve an actor

烈酒焚心 提交于 2019-12-13 07:04:36
问题 I have 1000 orders and I want to create an actor for each unique orderid. What would be the best way to safely create these actors while guaranteeing that I only have one per unique orderid? I have tried to first use ActorSelection, then if I can't find an actor with that id, I use ActorOf to create a new one, but when starting batches of these I will get a lot of ActorNotFoundException and when I then try to use ActorOf it fails with InvalidActorNameException. Example: try { actorRef = await

Akka.Net Streams and remoting (Sink.ActorRefWithAck)

我与影子孤独终老i 提交于 2019-12-13 04:00:52
问题 I've made quite a simple implementation with Akka.net Streams using Sink.ActorRefWithAck : a subscriber asks for a large string to a publisher which sends it by slices. It works perfectly fine locally (UT) but not remotely . And I cannot understand what's wrong? Concretly: the subscriber is able to send the request to the publisher which responds with an OnInit message but then the OnInit.Ack will never goes back to the publisher. This Ack message ends up as a dead letter : INFO Akka.Actor

Why am I getting a MissingMethodException when calling F# code from PowerShell?

馋奶兔 提交于 2019-12-12 18:25:05
问题 I'm trying to use PowerShell to call some F# code which uses Akka.Net actors. The F# code works fine in unit testing and when run from the F# interpreter, but when I call the same code from a PowerShell cmdlet I get the following exception: System.MissingMethodException: Method not found: 'Void Nessos.FsPickler.BinarySerializer..ctor(Microsoft.FSharp.Core.FSharpOption`1<Boolean>, Microsoft.FSharp.Core.FSharpOption`1<Nessos.FsPickler.ITypeNameConverter>)'. at Akka.FSharp.Serialization

Cluster sharding client not connecting with host

最后都变了- 提交于 2019-12-12 04:30:58
问题 After recent investigation and a Stack over flow question I realise that the cluster sharding is a better option than a cluster-consistent-hash-router. But I am having trouble getting a 2 process cluster going. One process is the Seed and the other is the Client. The Seed node seems to continuously throw dead letter messages (see the end of this question). This Seed HOCON follows: akka { loglevel = "INFO" actor { provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster" serializers {

Akka.NET query actors efficiently

时光怂恿深爱的人放手 提交于 2019-12-11 12:47:17
问题 I'm creating a proof of concept with Akka.NET for a production project but I'm facing a query concept understanding problem. Situation is a follows: CoordinatorActor has a list of thousands of Hotel-Actors . I would like to query all Hotel-Actors for all hotels with a room available on a specific date. Of course I could foreach through them and sent a .Ask<> request for the specific date. Holding a reference of all the tasks and do a Task.WhenAll(requests) . But that feels a little unnatural.