These are chat archives for akkadotnet/akka.net

13th
Sep 2016
riawz
@riawz
Sep 13 2016 05:45

I have an actor which itself loops, like GetMsg, ProcessMsg, if GetMsg is not null, then pass to ProcessMsg, otherwise, wait for a few seconds then tell itself to GetMsg again

what's the best way to test this kind of workflow?

GetMsg and ProcessMsg are two separate actors, which ProcessMsg is created by GetMsg
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:22
Anyone have experience with SimpleInjector and Akka.net together? I'm getting "Do not create actors using 'new', always create them using an ActorContext/System" when the container is verified.
I initialize like this
container.Register<QueryDataStoreActorBase, QuerySqlDataStore>();
var system = ActorSystem.Create("ActorSystem");
system.AddDependencyResolver(new SimpleInjectorDependencyResolver(container, system));
container.RegisterSingleton(system);
riawz
@riawz
Sep 13 2016 06:37
is there a way to ExpectMsg<MsgType>() multiple times?
Arjen Smits
@Danthar
Sep 13 2016 06:37
@hvidgaard system.AddDependencyResolver(new SimpleInjectorDependencyResolver(container, system)); is wrong
Just calling var resolver = new SimpleInjectorDependencyResolver(container, system); is enough
it registers itself with the system
the system.AddDepedencyResolver is a public api exposed for the DI plugins to use. It should not be used directly. Although it is possible, if you know what you are doing.
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:45
@Danthar Alright, removed that line, but the example still fails because SI creates all registered dependencies during verification.
Arjen Smits
@Danthar
Sep 13 2016 06:45
@riawz ExpectMsgAllOf ??
Oh? thats odd.
riawz
@riawz
Sep 13 2016 06:48
actually, I don't need it, I have actor A which creates actor B, B is roundrobin, but when I'm testing, I can only test against a single instance of actor B, so I don't need it, thanks
A will receive 2 response from 2 B instances, that's what I was thinking of testing but I can't find a way to "mock" router using testkit
Arjen Smits
@Danthar
Sep 13 2016 06:49
@hvidgaard it looks like the SimpleInjector plugin is still on 1.0.8 ?
The tests work. So plugin integration for 1.0.8 looks good
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:50
I've updated to the latest akka.net packages, I assumed that a minor version increase wasn't a problem.
Arjen Smits
@Danthar
Sep 13 2016 06:51
Have you ran the tests ?
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:51
no, I've used the NuGet packages.
Arjen Smits
@Danthar
Sep 13 2016 06:52
That would be a problem :P
If you upgrade, you should rebuild the plugin against the latest akka.net packages
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:52
okay, good to know...
Arjen Smits
@Danthar
Sep 13 2016 06:52
I just forked the repo and got the env open just now. ill check for you
It looks ok.
I gtg, got a meeting
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:56
alright, playing with it myself. Thanks so far
Arjen Smits
@Danthar
Sep 13 2016 06:56
but if you update the repo to have the plugin use the latest akka.net. And build a version explicitly targetting it, that should work
also check the tests project of the plugin, for details on how to register dependencies
could be the readme is wrong
gl!
Peter Hvidgaard
@hvidgaard
Sep 13 2016 06:57
ok, I'll try that.
Peter Hvidgaard
@hvidgaard
Sep 13 2016 08:10
@Danthar I figured out what was wrong. I had an Actor that was a base for my other Actors that query a datastore. When creating a class it automatically creates the base class as well, leading to the issue. Nothing to do with SImple Injector.
Arjen Smits
@Danthar
Sep 13 2016 10:09
ah, good to hear you figured it out. :+1:
Julien Adam
@julienadam
Sep 13 2016 13:16
Hey guys, I have a cluster running with 6 nodes including 2 seeds (A and B), all started at the same time. According to the logs, the leader is trying to move seed node B to [Up] every 3 or 4 seconds. Node B appears as "Joining" to my monitoring node but never goes to the Up status. No dead letters, no exceptions. I've restarted the whole cluster twice but the situation persists. Any ideas ?
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 13:29
@julienadam does seeds know about each other? what if you'll introduce a little delay between starting them?
Julien Adam
@julienadam
Sep 13 2016 13:42
all the nodes have both seeds set in the akka.cluster.seed-nodes config property. I'll try with a delay
interesting, it's always the last node I start that the leader is trying to move to Up but remains 'Joining' to the other nodes
Max
@maxpaj
Sep 13 2016 14:01
Anyone got experience with Akka.Persistence with Redis storage connector? I can't get it to work and I'm getting no errors... It's weird.
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:01
@maxpaj how are you configuring it?
Max
@maxpaj
Sep 13 2016 14:02
          persistence {
              journal {
                redis {
                  # qualified type name of the Redis persistence journal actor
                  class = "Akka.Persistence.Redis.Journal.RedisJournal, Akka.Persistence.Redis"

                  # connection string, as described here: https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Configuration.md#basic-configuration-strings
                  configuration-string = "localhost:6380,ssl=false"

                  # dispatcher used to drive journal actor
                  plugin-dispatcher = "akka.actor.default-dispatcher"

                  #Redis journals key prefixes. Leave it for default or change it to appropriate value. WARNING: don't change it on production instances.
                  key-prefix = "akka:persistence:journal"
                }
              }

              snapshot-store {
                redis {
                  # qualified type name of the Redis persistence snapshot storage actor
                  class = "Akka.Persistence.Redis.Snapshot.RedisSnapshotStore, Akka.Persistence.Redis"

                  # connection string, as described here: https://github.com/StackExchange/StackExchange.Redis/blob/master/Docs/Configuration.md#basic-configuration-strings
                  configuration-string = "localhost:6380,ssl=false"

                  # dispatcher used to drive snapshot storage actor
                  plugin-dispatcher = "akka.actor.default-dispatcher"

                  #Redis storage key prefixes. Leave it for default or change it to appropriate value. WARNING: don't change it on production instances.
                  key-prefix = "akka:persistence:snapshots"
                }
              }
            }
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:03
it looks like you're not setting the plugin
if you want to use it as default
Max
@maxpaj
Sep 13 2016 14:03
Oh okay, how do I do that?
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:04
akka.persistence.journal.plugin = "akka.persistence.journal.redis"
Max
@maxpaj
Sep 13 2016 14:05
Oh... Right. Thank you!!
I was following this https://github.com/akkadotnet/Akka.Persistence.Redis - I guess it should say something there?
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:06
it's common for all persistence plugins, but you're right - it should be mentioned in readme
Max
@maxpaj
Sep 13 2016 14:07
Alright! But how come it wasn't throwing any errors at me while my config was incorrect?
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:07
your config is correct (probably). It's just not used
Max
@maxpaj
Sep 13 2016 14:10
Right, so it's using the default configuration for persistence then, which is what?
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:10
by default, journal is in-memory
Max
@maxpaj
Sep 13 2016 14:12
Alright, how will that persist my events? Sorry, but this is strange to me... :'(
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 14:13
np ;) default journal stores all events directly in memory - it's not meant to be used for production, more for samples and testing purposes
so when your program stop, all events will perish
Max
@maxpaj
Sep 13 2016 14:14
Alright, that makes sense :)
Aaron Stannard
@Aaronontheweb
Sep 13 2016 19:48
@vladkosarev working on that today
@Horusiath Azure websites is fixed in dev
issue is that Azure websites doesn't support IPV6
Vlad Kosarev
@vladkosarev
Sep 13 2016 19:49
@Aaronontheweb thanks, we reverted to 1.0.8
Aaron Stannard
@Aaronontheweb
Sep 13 2016 19:49
yeah, sorry about that - trying to add support for IPV6 broke a ton of shit
growing pains there
although kind of surprised that so many parts of Azure don't support it - the thing has been out for like a decade
Aaron Stannard
@Aaronontheweb
Sep 13 2016 20:04
@Danthar @Silv3rcircl3 working on updating our build script so I can make it mono-friendly
for all of the plugins
TL;DR;, in order for our Docker strategy to work with Akka.Persistence I basically need both parts of the testing process to run inside a Docker container
that will allow me to link the containers
today that looks like running everything on Mono for the testing stage
in the not too distant future, .NET Core
Aaron Stannard
@Aaronontheweb
Sep 13 2016 21:04
@alexvaluyskiy @Silv3rcircl3 @Horusiath ready to merge I think: akkadotnet/akka.net#2294
that'll help me get the Mono suite passing
Bartosz Sypytkowski
@Horusiath
Sep 13 2016 21:04
ok, I'm merging that
Aaron Stannard
@Aaronontheweb
Sep 13 2016 21:05
just about have the PostgreSql test suite working on Mono
have to do a bunch of funky Linux-specific file globbing and crap
ty @Horusiath
Aaron Stannard
@Aaronontheweb
Sep 13 2016 23:23
alright, I give up - between half the shit for Akka.Persistence.PostgreSql not working at all on Mono and Docker on Windows Server 2016 barfing up segfaults when I try to run postgres on it
I've exhausted the options for getting builds running for it again
right way to fix this is to force all Akka.Persistence plugins to work on Mono only for the time being (i.e. build chain, drivers work on Mono or no CI) - SQL Server, on the other hand, we should be able to get working on 2016