akka.net

Is there an event in Akka.net cluster for when my node has joined a cluster?

有些话、适合烂在心里 提交于 2019-12-11 12:47:05
问题 In my Akka.Net cluster I have several nodes. There is communication that I'd like to initiate when I've successfully joined the cluster. I can see in the log that I'm welcome to the cluster: Welcome from [akka.tcp://Animatroller@hakan-el:8899] but I can't see any events I can subscribe to that are raised for this. 回答1: Usually what you want in that case is to subscribe to ClusterEvent.MemberUp , which current actor will receive, once new node will become part of the cluster. Example of actor

akkaNet test kit issue when testing messges sent from tested actor

六眼飞鱼酱① 提交于 2019-12-11 10:25:37
问题 I was trying to test message sent from tested actor, but getting timeout exception and a Dead letter info. As I am using ninject - created a mock method which always replays with probe actor reference. Am I missing something here? Assert.Fail failed. Failed: Timeout 00:00:03 while waiting for a message of type System.Type at Akka.TestKit.TestKitBase.InternalExpectMsgEnvelope(Nullable`1 timeout, Action`2 assert, String hint, Boolean shouldLog) at Akka.TestKit.TestKitBase

Akka.net remoting over Docker containers: client randomly fails to connect to host

一个人想着一个人 提交于 2019-12-11 08:39:14
问题 There is a simple host with a TestActor that only writes a string it receives to the console: using (var actorSystem = ActorSystem.Create("host", HoconLoader.FromFile("config.hocon"))) { var testActor = actorSystem.ActorOf(Props.Create<TestActor>(), "TestActor"); Console.WriteLine($"Waiting for requests..."); while (true) { Task.Delay(1000).Wait(); } } On the other side there is a simple client that selects the remote actor and passes a TestMessage to it, then waits on an ask without a

Akka.Net and In memory peristence

巧了我就是萌 提交于 2019-12-11 07:28:32
问题 I am trying to get my head around persistence and I am yet to be able to recover an actor. My intention is to get an Actor by its persistenceId (Same way we we get an Entity using GetById in DDD). I can get the reference to List and add it to a variable in List Manager but what I am looking for is that once the Actor dies how to get the Actor with its current state (Revovery By Events) so that modification can be done. Let me know if my question is not clear This is what I have done so far: *

Akka.NET not recognising my custom logger and defaulting to BusLogger

泪湿孤枕 提交于 2019-12-11 00:56:41
问题 I am learning Akka.NET. I am trying to create a custom logger. I followed a tutorial blog post here. I have been unable to get Akka to wire up my custom logger. Apparently the line var sys = ActorSystem.Create("AkkaCustomLoggingActorSystem"); reads in the Akka hocon and configures the logging as per the settings. When I check the value of sys after the actor system is created, I can see the configuration string saved but the logger is of type BusLogger instead of my custom logger. I checked

How to create an actor in a clustered configuration in F#

筅森魡賤 提交于 2019-12-10 23:35:47
问题 I'm creating a sample with Akka.Cluster with three nodes A, B and C where A is the lighthouse. So far, from the logs, the cluster works fine when there are no actors or when actors are local (created with spawn and spawnOpt ). I want to create an actor from B and access it from C. With let _ = spawne system "r-actor" <@ actorOf (fun msg -> printfn "Received: %s" msg) @> [] I get 2016-08-31 01:59:00.1185|INFO|Akka.Actor.EmptyLocalActorRef|Message String from akka://calculatorSystem/deadLetters

clustered consistent hash pool producing new routee for same mapping

佐手、 提交于 2019-12-10 22:23:44
问题 I have a solution with 2 command line projects that creates an akka.net cluster with a seed and client process. The seed starts the cluster and then instantiates a consistent-hash-cluster-router that performs hash mapping on any message that implements my interface "IHasRouting". So any IHasRouting message (from the seed or client) should end up at seed on a routee for the hash of that message. The projects start fine and the cluster forms without error. Both seed and client instantiate a

Akka.net starting and stopping with no activity

别说谁变了你拦得住时间么 提交于 2019-12-10 11:34:40
问题 I'm trying to send a message from a typesafe akka actor in Scala (2.4.11) to Akka.net actor in C# (1.0.4) I have a weird problem with my .Net actor, it keeps saying started then stopped, but I have no clue whats happening under the hood: A piece of Akka.net log: 2015-11-18 16:23:57.6168|DEBUG|Akka.Remote.Transport.ProtocolStateActor|Started (Akka.Remote.Transport.ProtocolStateActor) 2015-11-18 16:24:27.6578|DEBUG|Akka.Remote.Transport.ProtocolStateActor|Stopped 2015-11-18 16:24:42.6344|DEBUG

Akka.Net why are my pool actors not scaling up or down based on load

元气小坏坏 提交于 2019-12-09 23:18:05
问题 I am trying to build an actor system that can scale up/down based on the workload using the following configuration. akka { actor { serializers { wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire" } serialization-bindings { "System.Object" = wire } deployment { /analysis { router = round-robin-pool routees.paths = ["/user/analysis"] resizer { enabled = on lower-bound = 1 upper-bound = 20 } } } } } in my main loop I am creating 3000 messages and pushing to the actors for

How to store state in an F# Akka.NET Actor?

二次信任 提交于 2019-12-09 10:20:28
问题 In C# ReceiveActor s I can just have state as private fields in the class. How should I do this in an idiomatic way with the F# API? Is this a good idea? Any alternatives? let handleMessage (mailbox: Actor<'a>) msg = let mutable i = 1 match msg with | Some x -> i <- i + x | None -> () 回答1: The way you've proposed is entirely appropriate as a means of storing the state within the actor. The concurrency constraints of only processing 1 message at any time means that it's not possible to get