Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 21:07
    Aaronontheweb labeled #4238
  • 20:58
    cptjazz opened #4238
  • 20:45
    Aaronontheweb ready_for_review #4212
  • 20:45
    Aaronontheweb edited #4212
  • 20:45
    Aaronontheweb synchronize #4212
  • 20:37
    Aaronontheweb edited #4212
  • 20:37
    Aaronontheweb edited #4212
  • 20:36
    Aaronontheweb synchronize #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:26
    Aaronontheweb edited #4212
  • 20:25
    Aaronontheweb synchronize #4212
  • 20:00
    Aaronontheweb synchronize #4212
  • 19:46
    Aaronontheweb synchronize #4212
  • 19:39
    Arkatufus synchronize #4228
  • 17:10
    Aaronontheweb edited #4212
  • 17:10
    Aaronontheweb edited #4212
Hyungho Ko
@hhko
Akka.TestKit.Xunit2 supports .NET 4.5 currently.
Akka.TestKit.Xunit2 depends on Xunit 2.3.0.
Is it possible to support Akka.TestKit.Remote on .NET 4.5?
:smile:
Paladin
@DeepChipolino_twitter
Is it possible to stop reading events from ReadJournal, and start to read them from another offset without stopping the view?
Bartosz Sypytkowski
@Horusiath
@DeepChipolino_twitter depending on what you have in mind:
  1. Each ReadJournal method has a companion CurrentXYZ method, which completes the source, when there are no more elements visible in current journal backend.
  2. ReadJournal methods also accept from/to sequence numbers, so you can set arbitrary to which point you want to read your data.
  3. Optionally you can also combine ReadJournal source with KillSwitch to be able to manually complete stream at any point in time.
Paladin
@DeepChipolino_twitter
@Horusiath thanks!!
Lev Lehn
@llehn
Do I have to unsubscribe from EventStream? Or is it done for me when the actor dies?
jalchr
@jalchr

How can I get the children of a shard ?
In regular actor: we do this:

var child = Context.Child(actorName);

What should I do for a shard to query its children or check for existence ?

Bartosz Sypytkowski
@Horusiath
@jalchr are you trying to get children of your sharded actor? Or do you want to check which sharded actors are currently active within the shard?
jalchr
@jalchr
The second option
Bart de Boer
@boekabart
I have a question about basic Akka.Net, no remoting/clustering. It's about Dispatcher behaviour, I think.
I have a pipeline of actors (read xml to many fragments, process the fragments (in various ways, in about 3 parallel pipelines), then aggregate into a single actor, that outputs 'arrays' each N seconds, to a Serializer actor and then to a WriteFileContents actor.
What I observe, and this is unexpected, is that when I'm reading a 200.000 fragment xml file, I do quickly see some entities ending up in my 'buffer' , which gets triggered to output every 10 seconds, and it does output every 10 seconds roughly. However, it seems that under the 'load' of those many, many entities in the 'upstream' part of the system, that the couple of messages at the 'downstream' (after the buffer) get handled only VERY sporadically - at least less than once every 10 seconds (meaning that i'm going to write multiple files in the same second)
so it seems the default dispatcher behaviour doesn't help me to quickly 'stream' the pieces of data all the way to the end, it seems to prefer moving the entire bulk through the pipeline slowly ('breadth-first' instead of 'depth-first').
Bart de Boer
@boekabart
I would have thought that the default 100 messages limit on the mailbox processing (throughput ) would prevent that, and would give all actors a chance to handle their messages constantly (sub-second intervals). The processing of each message definitely does not take 1/10th second or even close to that.
Rohan Relan
@hanrelan
hi
i have a question about debugging when using akka
I'm getting an "Exception thrown: 'System.ArgumentNullException' in Akka.dll"
in my output window but I can't see the line number of the exception
or any other information
is there a way to get Akka to allow exceptions to raise as normal within actors
Rohan Relan
@hanrelan
or to get the stacktrace for the exception
Bart de Boer
@boekabart
step 1 would be to un-set 'just my code' in Visual Studio , and maybe enable all breaking on this particular exception (even if caught) in debug exception settings
then hope you can get the symbols downloaded...
Rohan Relan
@hanrelan
hmm i think i found the problem
potentially I was sending null to PipeTo
I'm not sure if that's allowed
Bart de Boer
@boekabart
I'm sure it's not ;)
HermansG
@HermansG
We encounter regularly the need that the behaviour of an actor must have one or more Receive methods in common for all states. In such cases we use a General()' method that is executed in every state transistionBecome(..). Is this a bad design? When not, is there an easier possibility in Akka to defineRecieve`-behaviours for all states?
Alexander Dorfman
@alexander-dorfman
Hi my name is Alexander, I work for big logistics company and recently discovered Akka (and similar Actor-Based frameworks). Today, I started going through internals of Akka, by stepping through the tests/benchmarks (PingPong in particular) in debug mode. What I am finding, is that for some of the internal classes, there is no documentation , only "TBD".
Would it be a good idea, if I can document some of the classes marked with "TBD" ?
Bartosz Sypytkowski
@Horusiath
@alexander-dorfman TBD markers have been generated by the tools to mark missing parts of the xml docs. Contributions on that field are always valuable.
Alexander Dorfman
@alexander-dorfman
@Horusiath Awesome ! I will see what I can do
Bart de Boer
@boekabart
@HermansG we do exactly the same - we just call it OnBecome()
ForrestWang
@ForrestWang

Hi, we use Akka.net for a while in our production environment already. recently, we are looking at Akka.net streams, and I have a question about it.

Let's say I have an Order class.

class Order {
public string OrderID {get;set;}
...
}

the logic is, we collect a bunch of orders and transform, save to database, a typically ETL process.

the prototype could be like this:

List<Order> orders = new List<Order>();

orders.add(new Order("orderID1"));
orders.add(new Order("orderID2"));

Source.From(orders).select(x=>x.OrderID = x.OrderID + "123").RunForeach(Console.WriteLine());

After that, obviously, the original order collection, each order's ID has _123 appended, so my question is, through each flow, should I create a new instance of Order and transform on the new instance, then pass the new one to the next flow, in other words, keep the original collection element immutable.

Bart de Boer
@boekabart
Yes, 1000 times yes. Just make it a habit to make your 'message' classes/structs immutable (so, eg. no {get; set;} , just { get; } and constructor setting.
Paweł Bańka
@pmbanka

Hi! I have a problem with clustering. I have 2 nodes which use sharding, and some lighthouses. After I restarted the nodes, they joined the cluster without issues, but the sharded actors cannot be spawned. The errors I get look like this:

Trying to register to coordinator at ["/system/sharding/ps_filesCoordinator/singleton/coordinator"], but no acknowledgement. Total [1600] buffered messages.

And there is a ton of them spamming all the time. The root cause seems to be related to restoring state of shard coordinator

{
  "Depth": 0,
  "ClassName": "System.ArgumentException",
  "Message": "Region [akka://Oddjob/system/sharding/ps_files#1292415200] not registered\r\nParameter name: e",
  "Source": "Akka.Cluster.Sharding",
  "StackTraceString": "   at Akka.Cluster.Sharding.PersistentShardCoordinator.State.Updated(IDomainEvent e)\r\n   at Akka.Cluster.Sharding.PersistentShardCoordinator.ReceiveRecover(Object message)\r\n   at Akka.Persistence.Eventsourced.<RecoveryStarted>b__90_0(Object message)\r\n   at Akka.Actor.ActorBase.AroundReceive(Receive receive, Object message)\r\n   at Akka.Persistence.Eventsourced.<>c__DisplayClass92_0.<Recovering>b__0(Receive receive, Object message)",
  "RemoteStackTraceString": null,
  "RemoteStackIndex": 0,
  "ExceptionMethod": {
    "Name": "Updated",
    "AssemblyName": "Akka.Cluster.Sharding",
    "AssemblyVersion": "1.3.2.0",
    "AssemblyCulture": "",
    "ClassName": "Akka.Cluster.Sharding.PersistentShardCoordinator+State",
    "Signature": "State Updated(IDomainEvent)",
    "MemberType": 8
  },
  "HResult": -2147024809,
  "HelpURL": null
}


Exception in ReceiveRecover when replaying event type ["Akka.Cluster.Sharding.PersistentShardCoordinator+ShardHomeAllocated"] with sequence number [8] for persistenceId ["/system/sharding/ps_filesCoordinator/singleton/coordinator"]

The wierd thing is that it fails on sequence number 8 when there is 21 entries in the DB.

Any pointers on what could be the cause of the error here? I don't understand what "Region not registered" means :|

(I know that I can probably fix it by purging the DB, but I'd like to understand why is it happening).

jalchr
@jalchr
wilddeveloperappears
@wilddeveloperappears
Hi, I'm trying to set the result of Context.GetLogger() at runtime to something different. Is this possible, and how would I do this? I don't want to use the Hocon to do this, because I want the logging infrastructure to do something unique for each ActorSystem that's running.
ryzam
@ryzam

Hi guys, I'm doing a demo project using akka cluster and facing a problem to send message to the cluster actor. Already run Lighthouse project as Seed-Nodes and I also can deploy the actor remotely and having actor reference but the actor are not able to receiving a message. If i change user-role=api then it can receive a message

class Program
    {
        static void Main(string[] args)
        {
            var config = ConfigurationFactory.ParseString(@"
                akka {
                        actor { 
                            provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""
                        }

                        remote {
                            log-remote-lifecycle-events = DEBUG
                            dot-netty.tcp {    
                                hostname = ""127.0.0.1""
                                port = 5001
                            }
                        }            

                        cluster {
                            #will inject this node as a self-seed node at run-time
                            seed-nodes = [""akka.tcp://akkademo@127.0.0.1:4053""]
                            roles = [actorserver]
                        }
                    }
            ");
            using (ActorSystem system = ActorSystem.Create("akkademo",config))
            {
                Console.ReadLine();
            }
        }
    }

and here is the API cluster side

    class Program
    {
        static void Main(string[] args)
        {
            var config = ConfigurationFactory.ParseString(@"
                akka {
                        actor { 
                            provider = ""Akka.Cluster.ClusterActorRefProvider, Akka.Cluster""

                            deployment {
                                /actorServerGraphQL  {
                                   router = round-robin-pool
                                   nr-of-instances = 10
                                   cluster {
                                      enabled = on
                                      max-nr-of-instances-per-node = 2
                                      allow-local-routees = on
                                      use-role = actorserver
                                   }
                                }
                            }
                        }

                        remote {
                            log-remote-lifecycle-events = DEBUG
                            dot-netty.tcp {    
                                hostname = ""127.0.0.1""
                                port = 5002
                            }
                        }            

                        cluster {
                            #will inject this node as a self-seed node at run-time
                            seed-nodes = [""akka.tcp://akkademo@127.0.0.1:4053""]
                            roles = [api]
                        }
                    }
            ");
            using (ActorSystem system = ActorSystem.Create("akkademo", config))
            {



                var actorServer = system.ActorOf(Props.Create<ActorServerGraphQL>().WithRouter(FromConfig.Instance), "actorServerGraphQL");


                actorServer.Tell(new QueryDatabase("Start query"));

                //var apiActor = system.ActorOf(Props.Create(() => new ApiActor(actorServer)), "apiActor");


                //apiActor.Tell(new QueryDatabase("Start query"));


                Console.ReadLine();
            }
        }
    }
Bartosz Sypytkowski
@Horusiath

Do you think this might help ? http://getakka.net/articles/clustering/cluster-sharding.html#retrieving-sharding-state

@jalchr sorry, but I'm out of the context.

jalchr
@jalchr
@Horusiath regarding the Getting the children for a shard ...
Bartosz Sypytkowski
@Horusiath
yes, if you need to know about alive entities living in the same shard
I've wrote once a blog post where I've described all query messages, that can be used to communicate with cluster sharding: https://petabridge.com/blog/cluster-sharding-technical-overview-akkadotnet/#getting-shard-metadata
jalchr
@jalchr
On GetShardRegionState shard region will reply with ShardRegionState containing data about shards living in the current actor system and what entities are alive on each one of them.
On GetClusterShardingStats shard region will reply with ClusterShardingStats having information about shards living in the whole cluster and how many entities alive in each one of them.
okay ... this gives info about "All active Shards" ... not a single one ... right ?
very well ...
Bartosz Sypytkowski
@Horusiath
@wilddeveloperappears you still can set up a separate HOCON config for each ActorSystem, with different logging in mind. In general it's not possible to setup a separate logging adapter per actor, as logging is running within actor system event stream. It doesn't discriminate different actors.
@jalchr yes, for a single shard, you have corresponding message types described bellow in the same article
jalchr
@jalchr

How can I query for the stats ? Is it a Tell or Ask ?

 _shard.Ask< ?? >(Shard.GetCurrentShardState.Instance);

or

 _shard.Tell(Shard.GetCurrentShardState.Instance);

and How I can get the response out of a 'Tell' ??

Bartosz Sypytkowski
@Horusiath
shard.Ask<Shard.CurrentShardState>(Shard.GetCurrentShardState.Instance); - it's described there, by convention query names have Getxxx prefix, while replies don't
with Tell, shard will simply respond to a message sender (an actor)