These are chat archives for akkadotnet/akka.net

29th
Apr 2016
Esun Kim
@veblush
Apr 29 2016 00:25
hay guys! I made a speech about akka.net on NDC 16 (Nexon Developers Conference). It is about developing real-time online game on Akka.NET. Its slide is uploaded at slideshare
And demo game is here. I hope that they like it and use it for developing their new games :smile:
Hyungho Ko
@hhko
Apr 29 2016 00:41
@veblush thank you for your good document and example.
Esun Kim
@veblush
Apr 29 2016 00:44
@hhko thanks :smile: : FYI korean one is also up there.
Hyungho Ko
@hhko
Apr 29 2016 00:45
@veblush i know it. I already download it^^;
thank you for your consideration.
Esun Kim
@veblush
Apr 29 2016 00:45
good to hear that. i hope that you can enjoy it.
Aaron Stannard
@Aaronontheweb
Apr 29 2016 00:46
@corneliutusnea gating a node won't prevent it from rejoining
@maxcherednik no you do not
as for why you see the log message 3 times... I really want to change the default logger to provide a default address if Akka.Remote is enabled
it's a pain in the ass to debug our MNTR tests and everything else without that
setting that aside
if you have 3 nodes observing that 1 node joining you'd see it three times
otherwise I don't know
Aaron Stannard
@Aaronontheweb
Apr 29 2016 00:53
@maxcherednik > guys, can someone explain the versioning of the project? it's 1.0.8 at the moment, I knew about the version 1.1. But now I see from time to time that the upcoming version is 1.5. How so?
1.5 is going to introduce breaking changes not to the Akka.NET API
but to our dependencies
we're throwing JSON.NET into the trash
no longer letting it be the default serializer
it's too stupid to handle a lot of serialization scenarios that are essential for Akka.NET
like immutable collection, C# 6 auto properties, F# DUs
on top of that it's slow
we'll also be replacing the transport layer
1.1 is still a placeholder for the general release of Akka.Cluster, but that'll may depending on which happens first
have a lot of stuff going on in parallel right now
Esun Kim
@veblush
Apr 29 2016 01:00
@Aaronontheweb it's sad about .net serializer issue. but wire is pretty good about handling those issues?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 01:16
@veblush as far as I know, @rogeralsing is the one to ask
Corneliu
@corneliutusnea
Apr 29 2016 03:30
guys, is there a way to know in a cluster who is "Me"? Basically what is the address of the current node so I can differentiate it in MemberUp/MemberDown or other cluster event ?
Esun Kim
@veblush
Apr 29 2016 03:55
@corneliutusnea for distinguishing me in cluster, I think Cluster.SelfUniqueAddress could be usuful.
var isMyself = (_cluster.SelfUniqueAddress == memberUp.Member.UniqueAddress);
Corneliu
@corneliutusnea
Apr 29 2016 04:12
@veblush yes, thanks
Corneliu
@corneliutusnea
Apr 29 2016 04:46
What are the "/temp/e", "/temp/f" actor addresses ? I have an actor (with a fixed address) asking another actor for some data and I can see in the receiver that the "Sender" us "/temp/e" while I clearly see the Self in the sender with the correct path
Esun Kim
@veblush
Apr 29 2016 05:05
@corneliutusnea Yes, it's the way akka.net implementsAsk method. When you call Ask method, it creates a temporary actor you saw as /temp/* and sends a message with a created actor.
Ask is just an extension method, not a member method of your sender actor. You can see Ask method at Futures.cs
Alex Valuyskiy
@alexvaluyskiy
Apr 29 2016 06:57
@Aaronontheweb are you planning to use Wire for persistence serialization?
Vagif Abilov
@object
Apr 29 2016 07:30
@Aaronontheweb what is the recommended JSON serializer for those who will want to serialize in JSON?
Arjen Smits
@Danthar
Apr 29 2016 08:12
@alexvaluyskiy when Wire is made the default serializer. It means that by default it will also be used for persistence serialization.
However you can override which serializer is used on an per-class basis
Its done via bindings, and explained in the docs. http://getakka.net/docs/Serialization
@object I don't think we have any official recommendations for that. We are ditching newtonsoft because it cannot do some of the things we need it to do.
Alex Valuyskiy
@alexvaluyskiy
Apr 29 2016 12:01
@Danthar what if I want to serialize all networks messages via Wire, and serialize the same messages to JSON, when I'm using persistence?
Chris G. Stevens
@cgstevens
Apr 29 2016 13:42
@schepersk I found my issue. The issue is actually when I upgraded to Helios 1.4.2. My internal app was using this and my demo was on 1.4.1.
Soon as I upgrade to 1.4.2 I get the same issue....
Chris G. Stevens
@cgstevens
Apr 29 2016 13:48
The following example https://github.com/cgstevens/AkkaRemoting
Demonstrates that running on 1.4.1 handles a removed node and rejoining of the service just fine... but on 1.4.2 it just gets stuck.
So in the project... Launch both workers. They will subscribe to each. When you close one out the other will ask for the identity but the .Ask task gets canceled in 1.4.2 and in 1.4.1 the Identity.Subject is returned with a null.
Kris Schepers
@schepersk
Apr 29 2016 13:50
@cgstevens Whohoow! Nice catch!
I'm also still using 1.4.1 since 1.4.2 doesn't seem to be working properly..
Chris G. Stevens
@cgstevens
Apr 29 2016 13:53
Yeah it took me a while ... had to create a new project and start looking at the differences and it just so happen that the new project had 1.4.1 instead of the 1.4.2.
Kris Schepers
@schepersk
Apr 29 2016 13:59
1.4.1 is still referenced by default in the akka packages..
Chris G. Stevens
@cgstevens
Apr 29 2016 14:08
ahhh
makes sense when I created the new project instead of just blindly updating.
Aaron Stannard
@Aaronontheweb
Apr 29 2016 15:47
@object you can still use JSON.NET
wdspider
@wdspider
Apr 29 2016 15:50
@Aaronontheweb Does an actor's PeristenceId only have to be unique per actor class? Or, does it need to be unique per instance of the actor class?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 15:51
@wdspider the latter
each persistent actor is responsible for incrementing its own sequence number
which is what gets used to distinguish the order of events that are replayed
the scenario you want to avoid is two different instances of the same entity competing for the same sequence numbers
which will inevitably result in data loss or corruption
in a clustered scenario where you might have lots of persistent actors
take a look at Akka.Cluster.Sharding
it has an elegant solution to that problem
wdspider
@wdspider
Apr 29 2016 15:54
ok
Aaron Stannard
@Aaronontheweb
Apr 29 2016 15:54
@alexvaluyskiy yep, that's the plan
Wire will be the default serializer for both Akka.Remote, Cluster, and Persistence
wdspider
@wdspider
Apr 29 2016 16:05
public override string PersistenceId { get; } = Context.Parent.Path.Name + "/" + Context.Self.Path.Name;
is only guaranteed to be unique when you use Akka.Cluster.Sharding then?
wdspider
@wdspider
Apr 29 2016 16:19
also, is there an Akka.Bootcamp for more advanced topics such as the Cluster and Cluster.Sharding stuff?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 16:51
is only guaranteed to be unique when you use Akka.Cluster.Sharding then?
no
it's only guaranteed to be unique if you design your hierarchy correctly
Akka.Cluster.Sharding just happens to do that for you
if you use something like a consistent hash router + child per entity pattern, which is basically what Sharding does anyway
that will also work
basically you just have to design your system so each entity gets pinned to exactly one node
which is how consistent hashing routers work
@wdspider nope, but I do offer paid trainings that cover all of those: https://petabridge.com/training
wdspider
@wdspider
Apr 29 2016 17:01
alrighty... thanks
kariem-ali
@kariem-ali
Apr 29 2016 19:11
Hi Guys. If I use PersistAllAsync and PersistAsync in two different message handlers in the same actor. Are the persisted objects guaranteed to be persisted in the order the messages came in?
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:17
hi all, I'm trying to write a simple integration test to verify that an actorSystem has joined the cluster, how can I proceed with this?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:17
take a look at the Akka.Cluster multi-node tests
I extracted some of the infrastructure we use to test the cluster into Akka.Cluster.TestKit
but that's not available as a NuGet package yet
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:18
cheers Aaron
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:18
but that's how we do that sort of testing
Akka.Cluster.Tests.MultiNode in the main repo
Alex Achinfiev
@aachinfiev
Apr 29 2016 20:22
@Aaronontheweb I would like to be able to use something like Twitter Zipkin to have a distributed trace of the Akka system. Would integrating with something like that be best done as extension to Akka.Monitoring or that library is not designed around similar concepts?
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:22
I take it that the JoinSeedNodeSpec is a good place to start?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:29
@mmisztal1980 any of them should do, but yeah that one is pretty simple
@aachinfiev Akka.Monitoring should work - I'd use Akka.Monitoring in combination with your own actor base classes that call all of the monitoring calls inside AroundReceive
that way you can get some aspect-oriented monitoring where you need it without wasting a ton of time writing infrastructure code
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:30
this is a bit new to me... If I understand, what I'm reading, right - this test fixture hosts multiple nodes? Can I include an externally running node somehow? The one hosted you-know-where? :D
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:30
the Akka.Monitoring API is a plus because you can switch out the monitoring implementation to something like performance counters for local dev and test
@mmisztal1980 there's a binary in there called MultiNodeTestRunner.exe
it's a custom XUnit2 runner that simulates a cluster
probably won't work on I-know-where
so in that case, here's what you can do
Alex Achinfiev
@aachinfiev
Apr 29 2016 20:31
@Aaronontheweb Thanks. That's the approach I was thinking off to leverage metric collection as well that can be used as annotations to the trace.
you can start a bunch of nodes within 1 process
using the normal testkit
and all you really need to do is assert from the perspective of at least 1 node that the other target nodes have joined
which you can do by subscribing to the cluster events
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:33
yes.... that would work
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:33
that would probably be easier
the MNTR has a steep learning curve
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:34
I've got catching up to do anyways so might as well start
and that last piece of advice sounds like a good direction
so that's what I'll be doing next :)
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:35
sounds good
other thing you can do, just realized
which is easier than subscribing to the events
is polling the ClusterReadView
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:36
that looks like a high-level cluster-api - am I right?
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:36
it's a volatile object, so you might need to use something like AwaitAssert to do a spinning assertion for a 3-5 second duration
yeah, the ClusterReadView is accessible from the Cluster object
so you can grab that from the ActorSystem pretty easily
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:37
nice, I'll be sure to explore this
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:37
Cluster.Get(yourActorSytstem)
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:37
yeah, seen that in one of the samples you've mentioned already :)
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:37
internally the MNTR uses it
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:37
looks like it's very easy to access
Aaron Stannard
@Aaronontheweb
Apr 29 2016 20:37
the trick with all of that stuff is AwaitAssert
which repeatedly tests the assertion for however long you specify
until it gets a successful result
or times out
Maciek Misztal
@mmisztal1980
Apr 29 2016 20:38
seems awfully similar to the Future class by Chris Patterson in his MassTransit testkit