These are chat archives for akkadotnet/akka.net

25th
Aug 2015
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 04:57
I just wanted to say how awesome I am finding Akka.net! Every time I think up a possible "what about x" problem there seems to be a solution already available. The latest is persistence / IsRecovering, here I was thinking, but when I replay events then all this unwanted business logic is going to run (like emails sending etc). Nope :)
Ivan R. Perez
@irperez
Aug 25 2015 04:58
And to think there is a ton more in the works! Looking forward to Akka.Cluster.Sharding!
Oleg Gavrilov
@OlegGavrilov
Aug 25 2015 11:30
hi guys!
If I want to ask actor from a mvc app - I can do it only by creating new actorsystem and resolve actor from it?
Alexander Prooks
@aprooks
Aug 25 2015 11:33
yes
Oleg Gavrilov
@OlegGavrilov
Aug 25 2015 11:34
thanks @aprooks
Alexander Prooks
@aprooks
Aug 25 2015 11:34
np:)
just make sure you don't create actor system per each request to an actor.
Pablo Castilla
@pablocastilla
Aug 25 2015 11:48
or to do it through a cluster :$ , for me Ask doesn't work :( I can not get the response through the cluster
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 11:49

I was wondering if someone could help me with clustering. As I've clearly missed something.

I'm playing with the samples (Cluster Transformation), and I'm trying to work out how to ensure there is on a single version of an actor with the same ID in the cluster.

In the sample, the LaunchBackend function is creating an actor with the path "backend". My initial understanding was that the paths would be unique over the cluster?

What's the pattern / example for ensuring an actors path is unique within the cluster? Is this a configuration change? Do I need to use cluster routers? (I've been trying this but there doesn't appear to be any change in behavior).

All help is much appreciated.

Pablo Castilla
@pablocastilla
Aug 25 2015 11:50
james-andrewsmith you need a consistent-hash-group router
well, that's if you need a router. On the other hand I think you can create the actor in your nodes and access them directly through the IP in the name.
Pablo Castilla
@pablocastilla
Aug 25 2015 11:56
look at the actor selection at the end
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 11:57

@pablocastilla Thank you!

So I tried a router with this config (adjusted for the example), but it still allowed duplicates.

"/backend-group" {
router = consistent-hashing-group
routees.paths = ["/user/backend"]
cluster {
enabled = on
nr-of-instances = 1
allow-local-routees = on
use-role = server
}
}

RE: creating an actor and direct access, do you mean creating an actor which subscribes to the cluster state and then having it handle direct assignment / reassignment via remote deploys. (I can do this, I just thought clustering gave me this out of the box)

Pablo Castilla
@pablocastilla
Aug 25 2015 11:58
I am not an expert, just starting with akka. But I would go with the cluster, it is more flexible
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:00

@pablocastilla As in try to get the routing to work? Fair enough, that seems like far less work. I really appreciate the remoting suggestions tho!

Any of the seasoned clustering pro's have some thoughts on how to get routing to do this?

Pablo Castilla
@pablocastilla
Aug 25 2015 12:00
This message was deleted
This message was deleted
Boban
@bobanco
Aug 25 2015 12:01
@james-andrewsmith cluster singleton will do that thing but its still not ready yet
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:02
@pablocastilla I don't I can constantly do it from two clustered notes, and the sample (https://github.com/akkadotnet/akka.net/tree/dev/src/examples/Cluster/Roles/Samples.Cluster.Transformation) actually has it as intended behaviour.
Pablo Castilla
@pablocastilla
Aug 25 2015 12:03
as @bobanco said it is possible. But with hashing only one will receive the message, won't it? @bobanco ?
Boban
@bobanco
Aug 25 2015 12:22
@pablocastilla yes
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:25
@bobanco Do you mean it's possible with the Cluster.Singleton package? Or that I should be able to do it today with routers? PS: Thankyou for your help
Roger Johansson
@rogeralsing
Aug 25 2015 12:29
@james-andrewsmith the cluster singleton is what you are looking for, but we have not yet fully ported it. its on its way, soon beta
Boban
@bobanco
Aug 25 2015 12:30
@james-andrewsmith Cluster.Singleton will ensure that at any given time you'll have 1 instance alive in the cluster, you can achive the same without the clsuter singleton but you will need to do the same things what cluster singleton does, and it's a lot of work.
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:31

@rogeralsing Thank you! That's great news - if I check out the cluster sharding branch would I get a functional preview or is a little while off.

@bobanco Thank you for clearing that up - I 100% understand now :)

Roger Johansson
@rogeralsing
Aug 25 2015 12:33
@james-andrewsmith not sure when we synced that branch, @Horusiath is the one working on it atm. so the latest bits would be in his forks branch
Sean Killeen
@SeanKilleen
Aug 25 2015 12:34
Hey all, while we're on clustering, I have a design question around it -- is this the best place or should I ask over in bootcamp?
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:35

@rogeralsing Thank you - I'll check it out!

Very excited for this next release!

Pablo Castilla
@pablocastilla
Aug 25 2015 12:57
@james-andrewsmith If you try with the router tell me if you can answer an Ask through it please, I am desperated with this.
James Andrew-Smith
@james-andrewsmith
Aug 25 2015 12:59
@pablocastilla I will let you know how I go!
Pablo Castilla
@pablocastilla
Aug 25 2015 13:03
thanks!
Sean Killeen
@SeanKilleen
Aug 25 2015 13:09
@pablocastilla IIRC you can think of the router as something that dumps the messages into the mailboxes of various actors. The sender in that case is still considered to be the original actor that sent the message. So if you create an actor or set of actors behind a router, you should be able to send a message which will send the message through the router, and then when the actor receives it, they still know who sent it, and can send a message back to the sender.
Not sure if the Ask functionality is supported across a router, but I imagine it would be
Hyungho Ko
@hhko
Aug 25 2015 13:56
Could i get QickSort example made by Akka.NET?
for simple and performance
Pablo Castilla
@pablocastilla
Aug 25 2015 15:52
@SeanKilleen I understand it that way but I think I have missed something or there is a bug :S. If you see my question in SO:
http://stackoverflow.com/questions/32185064/replying-an-ask-in-a-clustered-routee
I have one client actor: User, the router and later the routee can sent back the message to the User, even if I passed the User as an argument. The code is this
https://github.com/pablocastilla/AkkaConcert
and should work directly in your machine, it is very simple, at the end is the User actor --> router - group --> Concert actor. User and Concert in separate nodes of the cluster. If I don't use a cluster it works.
@SeanKilleen I would be glad if you can look at SO question
Sean Killeen
@SeanKilleen
Aug 25 2015 17:30
@pablocastilla I'm a little lost looking at the example -- could you explain to me what you'd like to happen between your actors without using Akka terminology?
@pablocastilla understanding the business concepts might help to model it better
Mikey
@BrainSlugs83
Aug 25 2015 17:50
Not sure if it's okay to ask here or if I should ask in the bootcamp room -- but for Akka.Persistence.TestKit -- is this needed to do unit testing with persistent actors? -- I noticed that with or without it my persistent actors in my unit tests still seem to use ForkJoin dispatchers and such -- also it seems it only works with Xunit? -- Is there any way to use HOCON in a unit test project to make the Persistence dispatchers into the regular calling thread dispatchers?
jweimann
@jweimann
Aug 25 2015 20:18
what's the status of cluster sharding? I think some of the problems people are having with clustering (including myself) was thinking the basic clustering system worked like sharding, without realizing it's a separate thing.
Dmitriy Tadyshev
@ditadi
Aug 25 2015 21:50
Any F# experts in here?
Anthony Brown
@bruinbrown
Aug 25 2015 21:51
@ditadi I might be able to help, what's up?
Dmitriy Tadyshev
@ditadi
Aug 25 2015 21:51
I'm looking at this article [https://petabridge.com/blog/akkadotnet-aspnet/] and i'm wondering how to do this in F#
Would I need to use ref values?
Anthony Brown
@bruinbrown
Aug 25 2015 21:52
Where are you wondering about using ref values?
Dmitriy Tadyshev
@ditadi
Aug 25 2015 21:54
When creating actors in Application_Start and then updating the static reference (SystemActors) to point to the newly created actors
F# doesn
F# deson't really have static constructors, so I'm trying to think of how I might get around that
Anthony Brown
@bruinbrown
Aug 25 2015 21:56
I've just put the actor system in a module as a let bound value like this https://github.com/bruinbrown/Spine/blob/master/Spine/Model.fs#L227 it's worked for me so far
Dmitriy Tadyshev
@ditadi
Aug 25 2015 21:56
Alrighty, I'll give her a try ty
Sean Killeen
@SeanKilleen
Aug 25 2015 22:22
Hey all, @pablocastilla and I talked for a bit about what he's trying to do and I have a question -- When creating / using a cluster, if I get an ActorRef, I don't need to put it in front of a router or anything, right? My actor ref is to the actor inside of the cluster itself and I just ask it things? (I could be totally wrong)
Say in the example of an actor representing a music lover that wants to buy tickets to a concert, and a "seat manager" that looks at what seats are available, returns tickets when asked, or lets the music lover know that the concert is sold out
In this case, we'd want to use a cluster for the seat manager and have the nodes gossip back and forth about which seats are available so we get an accurate response even when tons of people request tickets at once.
In that scenario, what does the design look like? My assumption is that the ActorRef that the client gets for the SeatManager is behind a cluster, abstracted away from the client. Is this correct?