These are chat archives for akkadotnet/akka.net

21st
Oct 2016
Andrew Young
@ayoung
Oct 21 2016 00:00
ok. just call cluster.Down() instead?
Aaron Stannard
@Aaronontheweb
Oct 21 2016 00:00
you could
but please write up an issue
Andrew Young
@ayoung
Oct 21 2016 00:00
ok
Aaron Stannard
@Aaronontheweb
Oct 21 2016 00:01
that LeaveAsync code will hang under this condition
if we don't do a check to see if we're Up first
and if we're Joining, we should just down ourselves
nice catch
Andrew Young
@ayoung
Oct 21 2016 00:01
is this something that you think i could fix?
Aaron Stannard
@Aaronontheweb
Oct 21 2016 00:02
the LeaveAsync code hasn't been written yet, but yeah you could - it'd basically be like
if SelfMember.MemberStatus == Up, then leave
if MemberStatus == Joining, then Down
and then we'd need to write a multi-node test to verify that this works as expected under both conditions
that part I could help with
Andrew Young
@ayoung
Oct 21 2016 00:02
ok. i'll give it a shot.
Peter Bergman
@peter-bannerflow
Oct 21 2016 11:36

This might be a stupid question, but how can instantiate a pooled router inline? I have come so far as this:

ActorOf(Props.Empty.WithRouter(new RoundRobinPool(ConfigurationFactory.ParseString("router = round-robin-pool nr-of-instances = 3"))));

But I don't know how to specify which actor it will use as routee. Perhaps someone can help me to get around this?

Bart de Boer
@boekabart
Oct 21 2016 13:14
Does anyone know why an actor's construction can not be private if you instantiate it with a props like Props.Create(() => new MyActor(...)) ?
Bartosz Sypytkowski
@Horusiath
Oct 21 2016 13:31
@peter-bannerflow ActorOf(Props.Create(() => new MyActor(...)).WithRouter(new RoundRobinPool(nrOfInstances: 3)))
wdspider
@wdspider
Oct 21 2016 15:57
Is there a way to log the Actor's name and/or path using the built-in nlog support without having to manually add it to each log message?
Gregorius Soedharmo
@Arkatufus
Oct 21 2016 16:10
you get it for free if you use that
wdspider
@wdspider
Oct 21 2016 16:15

that page doesn't say how though =/
Using the nlog target:

<target name="console" xsi:type="ColoredConsole" layout="[${level}] ${logger}: ${message} ${exception:format=tostring}"></target>

outputs messages like:

[Info] AmbassadorService.Core.Actors.EPPRegistryConnectionActor: Parsing client's binding IP Address (LocalIP=)

which is the class name of the actor, not the actual actor instance's name

Gregorius Soedharmo
@Arkatufus
Oct 21 2016 16:16
try deleting the layout part
and let akka use its own layout
wdspider
@wdspider
Oct 21 2016 16:17
That turns the message output to the following which is pretty similar:
2016-10-21 09:16:33.0860|INFO|AmbassadorService.Core.Actors.EPPRegistryConnectionActor|Parsing client's binding IP Address (LocalIP=)
Gregorius Soedharmo
@Arkatufus
Oct 21 2016 16:19
do you use ILoggingAdapter _log = Logging.GetLogger(Context); to get the logger?
wdspider
@wdspider
Oct 21 2016 16:22
yes
Gregorius Soedharmo
@Arkatufus
Oct 21 2016 16:23
weird, i got
[INFO][10/20/2016 5:03:11 AM][Thread 0027][[akka://SolehWebService/user/$a/$a/$d#2068446634]] ValidateUser failed.
when i use that
it prints the whole path with mine...
wdspider
@wdspider
Oct 21 2016 16:24

I think I just figured it out:

<target name="console" xsi:type="ColoredConsole" layout="[${level}] ${event-properties:item=logSource}: ${message} ${exception:format=tostring}"></target>

after noticing that the nlog adapter is adding the logSource as an nlog event-property: https://github.com/akkadotnet/Akka.Logger.NLog/blob/dev/src/Akka.Logger.NLog/NLogLogger.cs

which prints the following for the logSource:
[akka://AmbassadorServiceActorSystem/user/RootActor#1656471103]
Gregorius Soedharmo
@Arkatufus
Oct 21 2016 16:27
(y)