These are chat archives for akkadotnet/akka.net

11th
Apr 2016
Corneliu
@corneliutusnea
Apr 11 2016 07:36
Hyungho Ko
@hhko
Apr 11 2016 08:20
When using RoundRobinPool, how to find out the last processing message?
Could you recommend some good ways?
Arjen Smits
@Danthar
Apr 11 2016 08:23
@hhko put an actor in front of your RoundRobinPool that is responsible for forwarding messages to the pool and keeps track of the last message handed off.
Or. let your pool actors notify some well known actor that work has been completed for a specific item. And let that Actor keep track if the last processed message.
Or use the eventbus
Personally i like to use the eventbus for those kind of things.
Hyungho Ko
@hhko
Apr 11 2016 08:28
@Danthar how to use eventbus for this problem? Could you explain it?
Arjen Smits
@Danthar
Apr 11 2016 08:31
your pool actors publish a notification that work has been done
and you have an actor which subscribes to that message type
so your pool actors do something like this: this.Context.System.EventStream.Publish(new MyNotificationEvent());
and the other actor can then subscribe to the MyNotificationEvent message.
check the docs for more info: http://getakka.net/docs/EventBus
Hyungho Ko
@hhko
Apr 11 2016 08:35
@Danthar thank you. I can understand how to solve it very well because of your detailed explanation^^;
Arjen Smits
@Danthar
Apr 11 2016 08:35
note that an actor can also self subscribe by using Context.System.EventStream.Subscribe(Self,typeof(MyNotificationEvent));
Kris Schepers
@schepersk
Apr 11 2016 09:47
@Horusiath Seems like monday morning is a better moment to try things out :smile: Got my sample working now, sweet!
Another question though.. What happens with messages being processed or on the way to a region that shuts down or crashes? are they recovered automatically somehow or do you need to take care of that yourself?
Arthur Shvetsov
@ArthurShvetsov
Apr 11 2016 11:11
Hello, can someone explain what is the proper way of stopping remotely deployed actors ?
Zetanova
@Zetanova
Apr 11 2016 13:06
@Horusiath Yes, i had empty pids in the DB, cleared them out and recreated the clustered index and deleteted the old indecies.
Siemienik Paweł
@Siemienik
Apr 11 2016 15:42

Hi, i want to use akka remoting but i have error.

17:39; [Error]; ["akka://mtgmarket/system/endpointManager/reliableEndpointWriter-akka.tcp%3a%2f%2flocalActorSystem%40localhost%3a8060-1/endpointWriter/endpointReader-akka.tcp%3a%2f%2flocalActorSystem%40localhost%3a8060-1"]; ("0009"); Dropping message [Akka.Actor.ActorSelectionMessage] for non-local recipient ["[akka.tcp://mtgmarket@127.0.0.1:8050/]"] arriving at ["akka.tcp://mtgmarket@127.0.0.1:8050"] inbound addresses ["akka.tcp://mtgmarket@localhost:8050"]

There is my host hocon:

akka {
loglevel=INFO, loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
helios.tcp {
port = 8050
hostname = localhost
}
}

And other one, for client:

akka {
loglevel=INFO, loggers=["Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog"]
actor {
provider = "Akka.Remote.RemoteActorRefProvider, Akka.Remote"
}
remote {
helios.tcp {
port = 8060
hostname = localhost
}
}
}

I use ActorSelection:

AssortmentActor = system.ActorSelection("akka.tcp://mtgmarket@127.0.0.1:8050/user/assortment");
AssortmentActor.Ask("Pomocy!!!");

Any one can help me?

rajivharris
@rajivharris
Apr 11 2016 16:06
@Horusiath router considers the supervision strategy defined in the constructor
.WithRouter(new RoundRobinPool(3, null, new OneForOneStrategy(ex => Directive.Restart), null));
but not from props
.WithRouter(FromConfig.Instance).WithSupervisorStrategy(new OneForOneStrategy(ex => Directive.Restart));
from looking at the akka code "core\Akka\Actor\ActorRefProvider.cs", router takes the supervision configuration from props.deploy not from props.supervisionstrategy
so now I am not sure, how do it in Hocon, for the supervision strategy config to reflect in props.deploy
Davydov Denis
@Inkp
Apr 11 2016 16:13
Hello. What happens to stashed messages after actor's death by death pill? I have got an actor, which acts like a temporary message container, stashing all incoming messages untill someone else claims them. If no one claims them for a certain period of time this actor kills itself. Problem is I got: Message X from akka://MySystem/deadLetters to akka://MySystem/user/<message-container-actor> in my log timestamped with message-container-actor death time.
Aaron Stannard
@Aaronontheweb
Apr 11 2016 16:14
@Siemienik that's an easy one
localhost and 127.0.0.1 aren't the same address
localhost is an alias for 127.0.0.1
but when Akka.Remote compares its bound address (localhost) to the messaging address (127.0.0.1)
it goes
"wait, I received this message - but it wasn't addressed to me? WTF?"
and drops it
you can fix this by using the same address in both places
use localhost consistently or 127.0.0.1
but don't mix and match
Siemienik Paweł
@Siemienik
Apr 11 2016 16:16
Thank You:) It;'s works:)
Aaron Stannard
@Aaronontheweb
Apr 11 2016 16:16
:+1:
@rajivharris that sounds like a bug
Siemienik Paweł
@Siemienik
Apr 11 2016 16:16
:beers: 4 you:)
Aaron Stannard
@Aaronontheweb
Apr 11 2016 16:17
the router should always accept WithSupervisorStrategy too
there's no way to set supervision strategy for a router through HOCON though, since by definition SSes are expressed in code
Davydov Denis
@Inkp
Apr 11 2016 16:18
Code of my message-container-actor from the previous message, if that matters http://pastebin.com/kGKdZuBr
rajivharris
@rajivharris
Apr 11 2016 16:19
@Aaronontheweb Thanks for the quick reply. I will submit it in github, to track the issue.
Aaron Stannard
@Aaronontheweb
Apr 11 2016 16:19
@Inkp > . What happens to stashed messages after actor's death by death pill?
any time and actor dies
its internal state is annihilated
which includes the stash
if the actor isn't programmed to unstash its messages on restart / stop
Davydov Denis
@Inkp
Apr 11 2016 16:21
So then, I guess, that log message is not related to the container-actor itself
Aaron Stannard
@Aaronontheweb
Apr 11 2016 16:21
which 99.9999999999% of actors that use stashes do
then you won't see any messages
however, if you unstash on stop / restart
all of those unstashed messages will be dumped into deadletters
and DeadLetter events will be published onto the EventStream
containing each of those messages
so someone could theoretically grab them
Bartosz Sypytkowski
@Horusiath
Apr 11 2016 16:44
@schepersk no, they are not. For things like that you can use queues (like rabbitmq or azure service bus) or use at-least-once delivery from akka.persistence plugin
John Nicholas
@MrTortoise
Apr 11 2016 17:16
lo how is akka.net with dnx?
Aaron Stannard
@Aaronontheweb
Apr 11 2016 17:17
cc @adamhathcock
he'd be the one to tell you
John Nicholas
@MrTortoise
Apr 11 2016 17:18
thanks
Marc Piechura
@marcpiechura
Apr 11 2016 17:42
How can I watch an actor without an actor context ?
Bartosz Sypytkowski
@Horusiath
Apr 11 2016 17:42
@Silv3rcircl3 you can't
you need self IActorRef