These are chat archives for petabridge/akka-bootcamp

16th
Jul 2015
John Haigh
@haighis
Jul 16 2015 00:09
Is it possible to send a message (console application or web application) to a cluster?
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:10
you mean send a message to an Akka.NET cluster from a non-Akka.NET application?
John Haigh
@haighis
Jul 16 2015 00:13
no same cluster that are both an AKka.NET cluster. so console application A has a cluster name GroupRouterSystem with an actor called /user/testcoordinator, and console application b has cluster name GroupRouterSystem that is using a group router some like this to send messages to console application A system.ActorOf(Props.Empty.WithRouter(FromConfig.Instance), "test-group");
@Aaronontheweb i now have a group router working from within one console application but in the example above with two console applications I can't get console application b to send a message to the cluster
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:16
ok, these are two separate applications right?
John Haigh
@haighis
Jul 16 2015 00:17
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:19
so GroupRouterSystem2 can't send to GroupRouterSystem?
John Haigh
@haighis
Jul 16 2015 00:20
correct
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:20
have you been able to verify that GroupRouterSystem2 can contact one of hte GroupRouterSystem actor systems as a seed node?
i.e. have you seen the "Welcome from.." message show up on GroupRouterSystem2
John Haigh
@haighis
Jul 16 2015 00:23
Yes on GroupRouterSystem2 I see Node is JOINING and then I see leader is moving node to UP
does it look like it's coming from a GroupRouterSystem IP and port though?
that it looks like you might have tried to comment out the system1 seed node address
John Haigh
@haighis
Jul 16 2015 00:25
now I get a dead letter message on GroupRouterSystem2...which is better than getting nothing
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:26
my theory is that the group router may not actually have any routees on system 1
so I'd like to rule out a connectivity issue as the source of the problem
and then move onto just ActorPath issues
John Haigh
@haighis
Jul 16 2015 00:26
well should GroupRouterSystem2 have the the console a seed node in it's config https://github.com/haighis/AkkaNETGroupRouter/blob/master/GroupRouterSystem2/App.config#L56
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:26
have group router system 2 remove itself as a seed node
and see what happens
John Haigh
@haighis
Jul 16 2015 00:28
sorry when you say remove. what do you mean? like stop console b?
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:30
change that section of your HOCON config to read like this:
cluster {
    #will inject this node as a self-seed node at run-time                         
    seed-nodes = [
    "akka.tcp://GroupRouterSystem@127.0.0.1:2551"
    ]
    roles = [program]
    auto-down-unreachable-after = 10s
}
that seed node address belongs exclusively to GroupRouterSystem
so only it can welcome GroupRouterSystem2 to the cluster
therefore, in order for you to receive a Welcome / Join / Up message
connectivity must definitely be established
which eliminates an entire class of debugging scenarios
John Haigh
@haighis
Jul 16 2015 00:31
oh okay...learning something here..that's good... :)
so with that config from GroupRouterSystem2 i get a welcome message on it's console output [INFO][7/16/2015 12:32:25 AM][Thread 0017][[akka://GroupRouterSystem/system/clus ter/core/daemon]] Node [akka.tcp://GroupRouterSystem@127.0.0.1:2551] is JOINING, roles [program] [INFO][7/16/2015 12:32:26 AM][Thread 0016][[akka://GroupRouterSystem/system/clus ter/core/daemon]] Leader is moving node [akka.tcp://GroupRouterSystem@127.0.0.1: 2551] to [Up]
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:36
heh, looks like GroupRouterSystem2 got elected the leader :p
ok, that's good
connectivity established then
no messages going through yet?
John Haigh
@haighis
Jul 16 2015 00:37
dead letters: send path akka://GroupRouterSystem/user/test-group [INFO][7/16/2015 12:36:52 AM][Thread 0004][akka://GroupRouterSystem/user/testcoo rdinator] Message Message from akka://GroupRouterSystem/deadLetters to akka://Gr oupRouterSystem/user/testcoordinator was not delivered. 1 dead letters encounter ed.
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:38
aha, I know why that is
because the group router is including a path for an actor that doesn't exist on GroupRouterSystem2
because both applications are in the same role
try putting them into separate roles
John Haigh
@haighis
Jul 16 2015 00:43
okay console b cluster config at bottom of hocon is program2, and console A cluster config is program
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:44
so I assume now that you don't see anything at all happen, right?
John Haigh
@haighis
Jul 16 2015 00:45
no dead letter messages, but no message sending
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:46
ok
remember how to check the number of routees on a router?
var routees = routerActorRef.Ask<Routees>(new GetRoutees());
let's do that and make sure that your router has some routees it can try to message when you send a message to it
John Haigh
@haighis
Jul 16 2015 00:48
so i do this right in send to message in console b program.cs?
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:48
yeah, I would do that ask and then write the result to the console
or log it
you can use a ContinueWith off of the Ask to do it async if you want
but that'll let us know if the router's actually seeing routees across the network
if it is, then it's just a matter of tweaking the router to message the right address
if it's not, then we might still have a configuration issue
with the cluster seed nodes
or something else
John Haigh
@haighis
Jul 16 2015 00:52
no routees var routees = _testCoordinator.Ask<Routees>(new GetRoutees()); Console.WriteLine("has routees" + routees.Result.Members.Any());
Any() is coming back false
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:52
ok, then we have a connection problem
can you post the screenshots for both actorsystems once they're running
err, both applications
clearly mark which is which
because maybe I'm not clear on that at the moment
John Haigh
@haighis
Jul 16 2015 00:55
blob
A = console application A and B is console application B
my paint skillz....rock
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:57
hahaha
so quick question - are you passing in port 2551 as a commandline argument to B?
John Haigh
@haighis
Jul 16 2015 00:58
yes, LaunchBackend(new[] { "2551" });
Aaron Stannard
@Aaronontheweb
Jul 16 2015 00:58
ah, well that would do it
Helios uses port-sharing by default
but you can't have two applications both running on the same port
the seed node I thought you were using for A is also on 2551
so the two systems aren't in contact with eachother right now
John Haigh
@haighis
Jul 16 2015 00:59
oh snap...
now I am getting a proper Welcome on console and when console b joined console A....has output !!!!!!!!!!!!!!
yes.....it works. OMG>>>
high fives..
John Haigh
@haighis
Jul 16 2015 01:04
@Aaronontheweb thanks so much for your help...
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:05
whiskey-approval.gif
that's for you @haighis
now you have the power!
John Haigh
@haighis
Jul 16 2015 01:09
funny...
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:10
I love that gif :p
anyway, glad I could help!
so much of this stuff with clustering involves just having a set of consistent seed nodes across the cluster
John Haigh
@haighis
Jul 16 2015 01:12
well i learned lots in our short conversation here..i am going to go and document this in my code. you can do it from memory but there is a lot of config that needs to be in a build book..for me anyways..
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:12
nah, it's not just you
it's something we have to improve in a ton of areas across the project
I can never remember what the f*ing logging configuration options are
and I helped write some of them!
but yeah, I also have the advantage of being asked tons of debugging questions from Akka.NET users all the time - so each time a set of issues like this comes up I sort of know where to look for issues already
that's already paying me big dividends in the StackOverflow karma department :p
John Haigh
@haighis
Jul 16 2015 01:16
would having this example with good comments behind the details (cluster names the same, roles) be something that could go in the akka examples in https://github.com/akkadotnet/akka.net/tree/dev/src/examples?
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:17
we're actually working on cutting down / cleaning up the samples - just got proposed today during our core contributors meeting :p
so I don't know, tbh, but I think the best thing you could to give back would be to write a blog post about it and a good readme for the sample
John Haigh
@haighis
Jul 16 2015 01:18
okay
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:18
people get a lot of value out of that even if they aren't part of the core project
and if you email it to me I'll make sure we blast it out on the official Twitter and so forth
John Haigh
@haighis
Jul 16 2015 01:19
okay..cool thanks.. will do..
Aaron Stannard
@Aaronontheweb
Jul 16 2015 01:19
(we always give our users social media love)