Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Oct 14 21:02
    Aaronontheweb synchronize #3975
  • Oct 14 21:02
    Aaronontheweb opened #3975
  • Oct 14 20:11
    IgorFedchenko commented #3973
  • Oct 14 20:10
    IgorFedchenko synchronize #3973
  • Oct 14 20:06
    IgorFedchenko synchronize #3973
  • Oct 14 20:06
    IgorFedchenko synchronize #3973
  • Oct 14 19:42
    IgorFedchenko edited #3973
  • Oct 14 18:08
    Aaronontheweb commented #3937
  • Oct 14 17:27
    Aaronontheweb commented #90
  • Oct 14 17:26
    Aaronontheweb commented #90
  • Oct 14 17:25
    Aaronontheweb assigned #90
  • Oct 14 17:16

    Aaronontheweb on dev

    Provide static GetRoutees.Insta… (compare)

  • Oct 14 17:16
    Aaronontheweb closed #3974
  • Oct 14 17:16
    Aaronontheweb milestoned #3974
  • Oct 14 16:05
    jackowild opened #90
  • Oct 14 15:08
    Aaronontheweb commented #3974
  • Oct 14 15:08
    Aaronontheweb commented #3974
  • Oct 13 14:40
    cptjazz synchronize #3974
  • Oct 13 14:07
    cptjazz opened #3974
  • Oct 13 08:30
    ismaelhamed commented #3937
Shukhrat Nekbaev
@snekbaev
@Havret I don't see quarantine related messages in the console output, only gating for 5s and disassociation due to VM being unable to reach the WebApp. After 5 second WebApp can send another mesage and it will be received and processed, but reply will fail and this behaviour seems to remain until I restart the VM service. In this case association is created from WebApp -> VM. And VM's Akka doens't seem to require to associate back. However, if I restart the WebApp and VM's service sees it (via connection was reset by peer info log message) and try to reconnect, then it associates WebApp -> VM successfully, but at this moment VM's service Akka decides to also associate from itself back to WebApp and this fails which causes disassociation and 5s gating
Onur Gumus
@OnurGumus
@Horusiath , with akkling can we use object as the message type safely? Because doing so with persistent actor causes all messages such as ReplaySucceeded to come to actor as well. Perhaps the order should be changed for intercepting the messages.
Bartosz Sypytkowski
@Horusiath
@OnurGumus yes, you can use IActorRef<obj>, but then you'll catch any obj matching signature, including system messages sent to an actor. There's no easy way to just filter them out. Once I'll be done with porting akka-typed, then this will be much easier and consistent to do.
Zetanova
@Zetanova
hi, Why does the IPersistenceIdsQuery.PersistenceIds() not provide any filtering or offset logic? I cant find any other method to resume a query, beside the method with the EventsByTag + Offset. Is the regular why realy to save every LastSeqNr for each PeristenceId in a projection?
Bartosz Sypytkowski
@Horusiath
@Zetanova if I remember correctly PeristenceIds only give you the list of PIDs known up until "now". If you're intersted with continuous stream of all new incoming PIDs, you can use AllPersistenceIds method.
Onur Gumus
@OnurGumus
@Horusiath once I get the system messages, how can I return it back to system to be processed?
then first the message will be checked against system and if not object type will pick it up
ah of course then you can't access to the events even if you want to
Zetanova
@Zetanova
@Horusiath Thx, for the advice, ther is a CurrentPersistenceIds and PersistenceIds method. But what i am interested in is to resume a stream (process restart) without the help of EventsByTag. If there are a lot of PID's (>100k) the readJournal.PersistenceIds is getting useless. What should a process do with the PId's without any metadata like timestamp, ordering-id? It can only load each individual stream on every process restart. That makes the method readJournal.PersistenceIds for larger event stores not very unperformant.
AndreSteenbergen
@AndreSteenbergen
I have a question regarding the webcrawler example, when you have multiple apimasters and you set the routing algorithm to "router = consistent-hashing-group", would I really need to do a broadcast requesting if some other apimaster is already crawling that domain? Could I just simply check "Does this actor already have a crawler for domain XYZ"? The broadcast only really makes sense when it is round-robin instead of hashing? Or am I missing the point?
Chris G. Stevens
@cgstevens

I am trying to test an actor that is using PubSub; _mediator = DistributedPubSub.Get(Context.System).Mediator.
But when I run my test I get a "System.NullReferenceException: 'Object reference not set to an instance of an object.'"
The DistributedPubSub doesn't seem to get initialized and not sure how or what I need to to do.
The website, https://getakka.net/articles/actors/testing-actor-systems.html#configuration, has a todo on it: TODO describe how to pass custom config as I figure I need the config.

Within the [Setup] of the test I tried adding the following with no luck.
Sys.Settings.Config.WithFallback(Akka.Cluster.Tools.PublishSubscribe.DistributedPubSub.DefaultConfig());

I doesn't even want to test the actual PubSub part... Are there any examples on this?

Havret
@Havret
@cgstevens You can inject Mediator inside you actor and test it like any other IActorRef dependancy.
Peter Huang
@ptjhuang
@cgstevens the problem might be that the test actor system is already initialised for you by testkit. You might want to create your own actorsystem setup with PubSub and that for testing. (Furthermore, you'll find Sys.Settings.Config.WithFallback(Akka.Cluster.Tools.PublishSubscribe.DistributedPubSub.DefaultConfig()) will just give you back a new instance of a Config and not do anything with it - it's an immutable object)
Peter Huang
@ptjhuang
@AndreSteenbergen Suppose you have 2 web servers A and B, 1 api master X, and 1 more api master Y just joined. Server A picked up the new API master, but Server B has yet to learn of the new API master. Request 1 comes in via web server A, gets routed to API master Y. Request 2 comes in via web server B, gets routed to X. X might start working on the same URL too. Could that be the reason? I'm interested to know from the experts. In cases where correct message destination is important, e.g. a multitenancy design where we want an actor sub-tree per tenant, does consistent hashing group guarantee the message ends up at the right actor save spawning a second tree for the tenant?
Mike Bridge
@mikebridge
@snekbaev I ended up sending the events through to the actorsystem from WebApi via an Azure EventHub. This simplifies things quite a bit---no need for a remote actor system or a cluster or anything.
Shukhrat Nekbaev
@snekbaev
@mikebridge I'm still waiting for @Horusiath or @Aaronontheweb to reply. Meanwhile made a small PoC with akka io. It feels like it is partially replicating how remoting works. Basically, client keeps on retrying to connect to the target VM's service every 5s. When connection is established, WebApi sends messages to local actor, which internally wraps into another message, adds correlation id and stores correlation id <-> Sender mapping in the dictionary, because I need to receive a reply from VM's service. Then via json.net serialize the object and send. Receiving end deserializes it and sends to the proper actor, after processing it replies back (with correlation id) to the connection handler actor which in turn serializes back and sends to the WebApi. On WebAPI's site corresponding recepient is selected from the dictionary and message is send to it. All in all, it seems like calling code from WebAPI can still be doing the .Ask and that complexity is hidden from it. Of course I wish there was a switch to the remoting, because it's way to much boilterplate now. Also, probably, not so great custom tcp connection establish/retry related logic, plus routing and custom correlations... http would have been simpler. Maybe will rework this one day when migrate to .net core. For now just made an unvalidated assumption that TCP will be faster, given that this specific logic can be quite bursty.
Mike Bridge
@mikebridge
@snekbaev I've managed to keep this simple by keeping state outside webapi and pushing client messages out via pusher, so it's kept the networking architecture pretty straightforward. Not sure if this is the best way to do it but putting Akka.Net in the middle to manage some weird state with nothing but event input doesn't feel too cumbersome.
Shukhrat Nekbaev
@snekbaev
@mikebridge absolutely, if that works best for your scenario, definitely. I needed a reply for the .Ask call initiated from the WebApi's side. Also I thought that using the same approach I could have a pub/sub for certain potential future scenarios without using/adding any other technologies, but that's open to R'n'D tbh.
Dan Albrecht
@Dan-Albrecht
Anyone have an example of code doing config substitution? I just have markers in the config file right now and doing a find/replace before passing it to ConfigurationFactory.ParseString...gotta be doing it wrong.
Bartosz Sypytkowski
@Horusiath
@snekbaev sorry, but I don't have an obvious answer for you. What I can think of in your scenario is to use ClusterClient from Akka.Cluster.Tools to connect web app as clients and hook to you web application lifecycle to order it to shutdown gracefully (via ActorSystem's Shutdown).
Bartosz Sypytkowski
@Horusiath
@Dan-Albrecht depending on how massive these substitutions are:
  • if I'm right ${ENV_VAR} should work with environment variables substitutions by now
  • if I need to sustitute few config values from code, I'm just building a HOCON string directly in code (lame I know, but we're working on making dynamic in-code configs possible)
  • if I need to substitue a lot (like dev/prod), I just have my-project.dev.conf and my-project.prod.conf and depending on the build specifics I'm loading one file or another.
AndreSteenbergen
@AndreSteenbergen
@angrybug ah that does make sense
Shukhrat Nekbaev
@snekbaev
@Horusiath thank you for your reply. For that I will need to start using clustering in this stand-alone VM's service, that's the downside, but the upside is the cluster client (coming from WebAPI) will be able to connect directly to it and cluster itself will never try to connect to the client, thus disassociation will never happen. Is my understanding correct? And two more questions: what happens if WebAPI won't gracefully shutdown its cluster client? And do you happen to remember some good example you can point to that deals with akka io. I made own version which is a hybrid of docs + your blog post. Seems to be working ok, just want to make sure I'd handling/disposing things correctly. For example, when shutting down the server part, I'm getting the deathpactexception coming from the ReceiveListener and some deadletters with SocketEventArgs or something like that
Dan Albrecht
@Dan-Albrecht
Thanks @Horusiath . We currently have 15 environments, so want to avoid going down the one file per env route. Will play around with having a single shared defaults file and constructing a HOCON string in code for the per-environment stuff and slapping them together with WithFallback. Was initially opposed to doing environment variables, because I'd have to write code to set the environment variables, but that might be the cleanest solution...
Aaron Dandy
@aarondandy
Maybe somebody can help me out with this: My context is that I am coming from a background where I was playing with Orleans and using Service Fabric (virtual) actors. I understand that Akka actors are not virtual but what I don't understand is how I avoid running out of RAM. I'm assuming there is some pattern involving the actor hierarchy but I can't find a clean way to understand how that would look in practice. If I have a parent manage the lifetimes of the child actors, reactivating them and putting them to sleep, that sounds like a bit more work for lazy old me. And if I get a bit more motivation I still have a problem where I am making a parent actor a single bottleneck for messaging. What am I missing? What does a long lived actor system look like? How are you all approaching problems where you have new entities appearing in a system and slowly fading out of common use but not vanishing entirely?
Ismael Hamed
@ismaelhamed

@aarondandy I see two main design patterns, depending on your use case:

1) Actors with identity (like users, games, devices, etc), when you need to evenly distribute actors across the nodes in a cluster. Also, see passivation in cluster sharding for getting actor out of memory when they're idle.
2) Routers, for those cases in which you just need a bunch of actors to perform some work in a load-balancing fashion. If you need to route work with a certain key to the same routee, see the ConsistentHashing routers.

Otherwise, I think you're pretty much on your own when it comes to managing an actor lifecycle.

Havret
@Havret
Is it possible to use akka persistance without binary serialization? I mean to persist events in event journal (sql server) in human readable way?
Aaron Dandy
@aarondandy
Thanks for the leads ♥️
Ismael Hamed
@ismaelhamed
@Havret like the JSON serializer?
Havret
@Havret
@ismaelhamed Yep, sth like that.
Aaron Stannard
@Aaronontheweb
@Havret I thought JSON.NET was the default for Akka.Persistence.Sqlserver?
Havret
@Havret
@Aaronontheweb Yes it is, but it saves data in binary format. I would like to have it as a plain string.
Onur Gumus
@OnurGumus
@ismaelhamed when a new persistent actor created, how does it know it is a new actor or one that needs recovery from database ?
Bartosz Sypytkowski
@Horusiath
@OnurGumus every persistent actor has to define its persistenceId - it's a reference identifier used to track all of the events that correspond to this logical entity. Akka.Persistence requires to have only once actor with given persistenceId at the time (otherwise you can corrupt the actor's state), it up to you to fulfill that requirement. One simple way is to keep all actors under the same parent (if possible). Also other parts of the platform, like Akka.Cluster.Sharding can help you with keeping one entity at the time.
Shukhrat Nekbaev
@snekbaev
@Horusiath, @Aaronontheweb when Akka.NET Remote is used with WebApp it needs a special remoting settings (enforce-ip-family = true, dns-use-ipv6 = false etc.). Those are documented. I've refactored the old remoting logic into Akka IO. It works locally and on LAN, however, when WebApp is published it doesn't seem to connect. Are you aware of config/code changes required to make it connect? Thank you!
Amongst logs: Could not establish connection because finishConnect never returned true (consider increasing akka.io.tcp.finish-connect-retries)
Shukhrat Nekbaev
@snekbaev
in code using _remoteAddress = new IPEndPoint( ipAddress, port ); where ipAddress is IPAddress for both client and server
Shukhrat Nekbaev
@snekbaev

could it be the

public TcpOutgoingConnection(TcpExt tcp, IActorRef commander, Tcp.Connect connect)
            : base(tcp, new Socket(SocketType.Stream, ProtocolType.Tcp) { Blocking = false }, connect.PullMode)

it creates a new socket, which internally seems to assume it's ipv6 and turns on the dual mode. Given the remote config settings, I think there it is strictly disabling anything related to ipv6. Maybe that's why it can't connect...

Shukhrat Nekbaev
@snekbaev
ok, I can confirm it is exactly that. Added the address family and bingo, will open a GitHub issue
Chris G. Stevens
@cgstevens
@Havret and @AndreSteenbergen
Thanks for the replies! Sorry i have not been on as I have been head down.
I did end up just injecting the DistributedPubSub into my actor and everything seems to be working great.
Thanks you for your help last week.
Peter Huang
@ptjhuang
Version tolerance of Hyperion - if a new version of an assembly adds a new property to a type, and the VersionTolerance setting is true, should it successfully deserialize a stream to the new version? Had a look at DefaultCodeGenerator.cs, it seems the field orders are important. But even if that's observed, I've got a gist that seems to fail when adding new property. https://gist.github.com/angrybug/5e63b0ac8945d51fd62f5279a5db6c0d Often, we upgrade a microservice adding a few properties, it would be nice to just swap over to new version without recompiling all the dependent services. Is it general best practice to turn version tolerance off?
Shukhrat Nekbaev
@snekbaev
here's the issue: akkadotnet/akka.net#3679
joowon
@HIPERCUBE
Peter Huang
@ptjhuang
@HIPERCUBE doesn't look like it. It's tricky to implement the query API as it is supposed to be able to monitor log additions. For many rdbms that means polling which is hard to make performant
joowon
@HIPERCUBE
@angrybug https://github.com/AkkaNetContrib/Akka.Persistence.PostgreSql/tree/dev/src/Akka.Persistence.PostgreSql.Tests/Query
I found persistence-query related test code in postgresql provider repo
Is it meaningless test code?
joowon
@HIPERCUBE
‘’’
ReadJournal = Sys.ReadJournalFor<SqlReadJournal>(SqlReadJournal.Identifier);
‘’’
It seems like using ‘SqlReadJournal’ for persistence query when using postgresql.
I tried with SqlReadJournal and postgrsql, but it doesn’t work.