These are chat archives for akkadotnet/akka.net

7th
Oct 2016
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 08:13
@andreyleskov I don't know, if you companion plugins have nightly builds, but the best way is to check it out
Nicola Atorino
@NicolaAtorino
Oct 07 2016 08:14
@Horusiath thank you for your answer. The akka documentation says to serialize the atleastoncedeliverysnapshot in a byte array, and I tried also protobuf-net but it requires all type and subtype to be mapped beforehand. This is not possible because i canot know the kind of messages that the snapshot will contain inside beforehand. So how can i serialize that kind of object? How does akka.net manage this thing internally? Does it ever serialize object in a byteArray ?
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 08:15
@ayoung you're trying to send a message to remotely deployed actor by pinning it to a router, this sounds like overcomplicating things
@NicolaAtorino you can try to use Wire serializer (which will we the default serializer from v1.5 anyway) or just use something json-based
btw. what's wrong with serializing atleastoncedelivery snapshots right now?
Nicola Atorino
@NicolaAtorino
Oct 07 2016 08:28
@Horusiath we are using a custom serializer instead of wire because we have elastic as a persistence db (wire serialized object do not work well with it), and this custom serializer has problems with the snapshot object (especially, the actorPath subtype)
@Horusiath since i need my own state obj as a wrapper around the snapshot, i was following the documentation that ways to store the snapshot as a byteArray in a property of my own stateobj. And that's the reason i needed a bynarySerialization in the first place
but now i am thinking that instead of using a byteArray i can store it as a string, and use explicitly the wireserialization that should be able to work with that.
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 08:39
every akka serializer is capable of serializing object ot byte arrays
even if you have stream serializers, you can sent them MemoryStream and get byte array from it
Nicola Atorino
@NicolaAtorino
Oct 07 2016 08:44
in fact now i will try to use programmatically the ActorSystem.Serialization class
it works well. thank you @Horusiath
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 08:47
np ;)
Andrew Buttigieg
@andrewbuttigieg
Oct 07 2016 11:22
@Horusiath Ended up using XUnit and I can run parallel test from different assemblies so it solve what I was trying to do
Daniel D'Agostino
@dandago2_twitter
Oct 07 2016 13:32
Web crawler sample documentation says: "You also want to make sure you include your Akka.NET HOCON configuration inside Web.config, that way you can take advantage of Web.config Configuration Transformations in combination with HOCON."
is it actually possible to do config transforms on the HOCON?
Peter Bergman
@peter-bannerflow
Oct 07 2016 13:33
@dandago2_twitter Not sure if you can do transformations inside the hocon, but you can always replace the whole section with another hocon...
Daniel D'Agostino
@dandago2_twitter
Oct 07 2016 13:35
that's kind of radical, it's like saying replace a whole Web.config with another... but good point
it would be nice to be able to tweak specific properties per environment
Arjen Smits
@Danthar
Oct 07 2016 13:43
@dandago2_twitter What i have done is provide a base config in the normal hocon config section
and during app initialisation provide the override or fallback facilities of the hocon config system, to replace or inject environment specifics
these specifics can then be provided through any means you want. I use an app-setting and have my deployment CI env put in the right stuff during deployment.
ofcourse, if your deployment env can substitute variables in your config, you can do that with the whole base hocon config as well ofcourse
but i like to keep a seperation between the base stuff that applies to all instances, and the env specific stuff
Daniel D'Agostino
@dandago2_twitter
Oct 07 2016 13:50
that's a really interesting approach; is there an example somewhere of how to do these overrides?
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 13:51
@dandago2_twitter hoconConfig.WithFallback(fallbackHoconConfig)
if some key was not found in hoconConfig, it will be searched in fallbackHoconConfig
Daniel D'Agostino
@dandago2_twitter
Oct 07 2016 13:53
typically we put HOCON in the Web.config and it gets pulled automatically, so where does that hoconConfig part actually go?
Arjen Smits
@Danthar
Oct 07 2016 13:54
where ever you want
you could put it in an appsetting value in your config
and read it from there
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 13:54
when you're creating actor system by ActorSystem.Create("sys") this is actually a shorter form of ActorSystem.Create("sys", ConfigurationFactory.Load()) which loads config from web.config
Peter Bergman
@peter-bannerflow
Oct 07 2016 14:00

I have some issues with TestKit and xunit console runner. When I run my tests through VS they pass fine, but when using the console runner (as my CI tool does) they fail. The tests cases are basically doing the following:

  1. Create an actor, 2. Send it a message, 3. Expect another message back to the TestActor.
    When running the tests through the console, I observe that the message sent in step 2 is unhandeled:

[WARNING][2016-10-07 13:29:56][Thread 0005][akka://test/user/$c] Unhandled message from [akka://test/user/testActor1#360950702]: Common.Models.Messages.Worker.Parse

And that basically causes the test to fail. Would that indicate that the message is sent before the actor under test has been created?

Arjen Smits
@Danthar
Oct 07 2016 14:09
does it always fail ? or intermittenly ?
Peter Bergman
@peter-bannerflow
Oct 07 2016 14:11
Actually, never mind, I think it is a bug in my application code... :(
Arjen Smits
@Danthar
Oct 07 2016 14:12
ok
Peter Bergman
@peter-bannerflow
Oct 07 2016 14:56
Any way I could do a test with an assert like ExpectOneMsg<Foo>()?
To check that I don't receive multiple instances of the Foo message
Marc Piechura
@marcpiechura
Oct 07 2016 14:59
@peter-bannerflow ExpectMsg + ExpectNoMsg or ReceiveWithin and then check the result
Peter Bergman
@peter-bannerflow
Oct 07 2016 15:00
Ah I see, that could work, thanks
Andrew Young
@ayoung
Oct 07 2016 16:23
@Horusiath let me try to clarify a bit. my actor hierarchy is a bit like this hashPool -> process actors -> broadcastGroup. The hash pool at the top is what complicates things because it remotely deploys the process actors. that is what makes the actor selection so difficult for me to configure for the broadcast group.
Sean Farrow
@SeanFarrow
Oct 07 2016 21:40
Has anyone done anything using redis, specifically, subscribing to a channel and receiving messages in actors. I'm trying to communicate between a JavaScript application and a backend written using Akka.net actors. Any help appreciated.
Bartosz Sypytkowski
@Horusiath
Oct 07 2016 22:19
@ayoung to be honest I've never seen real use case scenario for consistent hash pool and 90% of the people trying it was actually misused it
Arjen Smits
@Danthar
Oct 07 2016 22:25
@SeanFarrow I have used the stackexchange redis client. Could not get the connection multiplexer to work properly inside an actor.
Dont know why, the multiplexer just didn't like it.
But i have not used channels. What i do though is setup the connection outside of an actor, and pass it in as a reference to an actor.
But what you can do is receive messages from your channel, and then send them into your actor system via an IActorRef
Does that help ?
Sean Farrow
@SeanFarrow
Oct 07 2016 23:27
@danthar, possibly I'll take a look. I was hoping to use Akka.Streams, but it seems that client won't allow me to, or will certainly have issues. I will have a lot of channels, So I need to work out whether one actor will do the trick or multiple actors are needed. The actors are sending back to a SocketIO node api.