Where communities thrive

  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
  • Mar 06 21:34
    SamEmber edited #4814
  • Mar 06 21:24
    SamEmber commented #4813
  • Mar 06 21:23
    SamEmber closed #4813
  • Mar 06 21:23
    SamEmber opened #4814
  • Mar 06 21:01
    SamEmber opened #4813
  • Mar 06 17:19
    to11mtm commented #70
  • Mar 06 16:51
    to11mtm commented #4698
  • Mar 06 16:43
    Larsus commented #50
  • Mar 06 00:06
    Aaronontheweb commented #4806
  • Mar 05 20:47
    Arkatufus commented #71
  • Mar 05 20:30
    Arkatufus commented #72
  • Mar 05 20:29
    Arkatufus commented #72
  • Mar 05 20:26
    Arkatufus commented #69
  • Mar 05 20:17
    Arkatufus commented #65
  • Mar 05 20:12
    Arkatufus commented #71
  • Mar 05 19:53
    CumpsD commented #70
  • Mar 05 19:51
    Arkatufus closed #36
  • Mar 05 19:51
    Arkatufus commented #36
  • Mar 05 19:49
    Arkatufus closed #23
  • Mar 05 19:49
    Arkatufus commented #23
Aaron Stannard
@sainzg hmmm
not sure off the top of my head
we're using an older version of the Azure Storage Client because the new Cosmos Db one isn't compatible with Azureite petabridge/Akka.Persistence.Azure#125
would you mind opening an issue here? https://github.com/petabridge/Akka.Persistence.Azure/issues
@crixo yeah the TestScheduler has to be manually advanced
won't run automatically
that's designed, ironically in this case, for deterministic testing purposes
were you able to fix your tests?
@Aaronontheweb , here you go let me know if more detail is needed petabridge/Akka.Persistence.Azure#140

Hi! I've a general question to you...

How do you document your messageflow? Is UML your weapon of choice? Have you any other tool?
Would be nice to hear some suggestions.


Aaron Stannard
thanks @sainzg - I appreciate it
Aaron Stannard
@/all Akka.NET v1.4.15 is now live on NuGet: https://twitter.com/AkkaDotNET/status/1351939117303681028
which includes our new Akka.DependencyInjection package
and we would love to get some feedback on that in the real world
Aaron Stannard
@mike-ammer I usually do a flowchart
for diagramming the message flow specifications
for charting the live messaging of running systems I tend to rely on distributed tracing for that
we're relying on Azure Application Insights for that today
but we're going to move off of it because it is ludicrously expensive
we'll probably adopt Jaeger instead
Aaron Stannard
@/all going live with our community standup now https://www.youtube.com/watch?v=blLK8lH_MQ0
Hell all,
Is it possible to broadcast a message to all entities in the same shard? For instance, I want to send one message to all entities that live in the shard customerupdated
Cristiano Degiorgis
@Aaronontheweb regarding the TestScheduler, thanks for the hint but now I'm confused... how should I use it then within a test scenario? should I invoke it explicitly from outside the actor/test?
@Aaronontheweb awesome news! I'll try on the weekend!!
Has anyone had any luck getting an automated instrumentation utility, NewRelic in my situation, to trace execution within the Akka runtime?
I'm getting the error "When using remember-entities the shard id extractor must handle ShardRegion.StartEntity(id)" even though the StartEntity is handled in the message extractor. Am I missing something? Hope someone will have time to answer me ;-)
public class CustomMessageExtractor : HashCodeMessageExtractor
        public CustomMessageExtractor() : base(maxNumberOfShards: 100) { }

        public override string EntityId(object message)
            return message switch
                NotificationActor.Subscribe sub => sub.ConnectionId,
                ShardRegion.StartEntity start => start.EntityId,
                _ => null

        public override string ShardId(object message)
            if (message is NotificationActor.Subscribe sub)
                return sub.EventName;

            return null;
Ismael Hamed
@fscavo ShardRegion.StartEntity needs to be handled in the ShardId extractor, not the EntityId
Thanks @ismaelhamed
I think the example in "Remembering entities" is wrong
@fscavo Ummm I think you might be accidentally misusing HashcodeMessageExtractor
b/c normally you should not override string ShardId(object message) from that class. I wonder if it should be sealed...
For your case, if you want shards to be off eventname like you show, you probably should just implement IMessageExtractor instead of inheriting HashCodeMessageExtractor
From a docs standpoint, it probably would help to provide an example with IMessageExtractor and StartEntity being handled, so users can see the difference

Is it possible to broadcast a message to all entities in the same shard? For instance, I want to send one message to all entities that live in the shard

Ummm I feel like there's a way to do that, let me think

.... I mean, I have no clue whether this works or would do what you need, but you could try an ActorSelection like /system/sharding/customer/customerupdated/* <-- Maybe it should be /user/ but I think it's /system/

.... I mean, I have no clue whether this works or would do what you need, but you could try an ActorSelection like /system/sharding/customer/customerupdated/* <-- Maybe it should be /user/ but I think it's /system/

It is indeed system

.... I mean, I have no clue whether this works or would do what you need, but you could try an ActorSelection like /system/sharding/customer/customerupdated/* <-- Maybe it should be /user/ but I think it's /system/

Thanks a lot @to11mtm
It is no longer needed because I went in a different direction but it is worth to try :-)
One more question, is it possible to configure the shard actor's supervision or even better tell akka sharding to use a custom shard actor?

I've just updated my project to the new DI package. It was very straightforward to get everything running again. Now I'm refactoring some actors to receive non-di parameters by constructor instead by message. Thanks @Aaronontheweb !
Farewell "initializing" phase! =D
Keith Emanuel

Hey everyone. I started up a project using Akka.NET after a few years of doing the tutorial and some small projects. Right now, it's mostly just pulling stock data and inserting into a Timescale database. Probably a pretty common use case :)

Anyways, I was wondering what the recommended approach might be to creating many singleton actors. A common case will be a simple ETL style pipeline. So, some sort of coordinator/conductor actors specifying what to download and when, then a extractor actor, possibly an actor to handle api rate limiting, then a loader actor to insert the data into the database.

I have a few of these created, but right now I just have everything initialized in the main method and passed through the constructors, which is pretty ugly, so I want to fix these before I create too many more of these pipelines.

A few (well, lots of) questions:

  • It seems like some DI packages specifically for Akka.NET recently came out. Guessing I should be using this?
  • Should I create a conductor (Is there a better name for this?) actor for each pipeline? And should the messages flow through the pipeline actors directly, or should they all be relayed through the conductor? It seems like could possibly make error handling easier, but message routing might be a little more awkward.
  • Should I define the pipelines in code, or in the database and create them at runtime?
  • For situations where I am loading data into a table, I will have a loader for each table working serially. Should I use async/await on the database call, or PipeTo? Since I want to do this serially (at least for now, since I am just using a single staging table truncated between requests and repopulated with postgres copy command), I'm thinking I should use async/await.
  • How much do I have to worry about message size if I am using a single machine on my home server? (Ryzen 3600 6 cores, 12 threads, 32 GB ECC ram, SDDs). Right now, I am putting entire files/streams in messages to load with the copy command, which is a efficient way to load data into postgres.

Sorry for the wall of text of questions.

12 replies
Jevgeni Tarasov
Hi everyone! Quick question about the project: is there F#-specific documentation? Because all I can find is archived. Is Akka.FSharp still a thing?
Hi - quick question regarding the Bootcamp ebook (purchase) - I bought in July 2020 and the source code uses the .net framework 4.8 - is there a .net core or .net 5 version available? Thanks!
Vagif Abilov
@devjev I recommend using Akkling with Akka.NET and F#.
Jevgeni Tarasov
@object Thank you!
Hey everyone!
We're starting to look into potentially moving our akka estate onto akka clustering. The question has been raised as to whether we should do one large cluster of all of our microservices (Probably would be ~50 nodes) or to have multiple small clusters. Does the cost of adding a new node into the cluster increase with the size of the cluster? Are there any stats that we could look at surrounding how much resources gossiping takes against the size of the cluster?
Our estate is a lot of microservices that are very distinct and a lot have their own bounded contexts so not all of them necessarily talk to any other service, for these we would be looking active/passive or to have sharding depending on what that particular service is doing. Does anyone have any opinions or experience with something like this? Any advice welcomed!
9 replies
Brah McDude
hi all. i have a deep basic question: shouldn't all state variables in an actor be declared as volatile? reason: an actor could get context switched between cpu-cores. effect: without declaring volatile - 2 cpu-cores might each have a stale version of the actor state variables in their cache. fix: with declaring volatile - cpu-cores never cache actor state variables.
Igor Fedchenko
@brah-mcdude hmm, this sounds like, when we are using await in any class's code it's variables have to be declared as volatileto avoid the problem you describe. The short answer is no, you should not need volatile keyword unless your message handling code for some reason requires it.
Hello. I'm new to Akka.Net and just trying to get something simple up and running. I am trying to use persistence but I keep getting the following
Error while creating actor instance of type Akka.Persistence.Snapshot.LocalSnapshotStore with 0 args: ()
[akka://AspNetDemo/system/akka.persistence.snapshot-store.local#1960469910]: Akka.Actor.ActorInitializationException: Exception during creation
---> System.TypeLoadException: Error while creating actor instance of type Akka.Persistence.Snapshot.LocalSnapshotStore with 0 args: ()
---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
---> System.MissingMethodException: Method not found: 'Akka.Pattern.CircuitBreaker Akka.Pattern.CircuitBreaker.Create(Int32, System.TimeSpan, System.TimeSpan)'.
at Akka.Persistence.Snapshot.SnapshotStore..ctor()
at Akka.Persistence.Snapshot.LocalSnapshotStore..ctor()
I'm using v1.4.16 of everything