These are chat archives for akkadotnet/akka.net

1st
Aug 2017
Edward Adjei
@eddadjei
Aug 01 2017 03:55
I know @Aaronontheweb recommends not for us to use "auto-down-unreachable-after : 10s" how can I properly handle disconnected nodes and transfer control over to another active node while using the ClusterSingletonManager @Aaronontheweb
Shamsul Amry
@ShamsulAmry
Aug 01 2017 04:27

@Silv3rcircl3 "Silently" means it will simply not work without throwing up any error (or it was actually me not knowing how to get that error). I tried passing:

ActorMaterializerSettings.Create(system).WithSupervisionStrategy(ex => {
                    return Directive.Stop;
                })

as parameter to system.Materializer() and put breakpoint on the return Directive.Stop, but the breakpoint was not triggered.

I'm simply following the word count example given at http://getakka.net/docs/streams/cookbook. If my distinct word count is <= GroupBy maxSubstreams, then it works OK. But if it's more, then it will simply return without any sort of visible failure, and no output whatsoever.

For output, I'm using a Sink.ForEach<Tuple<string, int>>(Console.WriteLine) that will just send the result to the console.

Marc Piechura
@marcpiechura
Aug 01 2017 05:58
@ShamsulAmry Decider is used for errors like if an exception is thrown in the provided select function, so it's more for "user" errors. The error that groupby "throws" when you use more substreams as allowed doesn't go through the decider, it will fail the streams immediately . When you call stream.Run(materializer) you should get some Task back and this Task contains the exception
Shamsul Amry
@ShamsulAmry
Aug 01 2017 06:30
@Silv3rcircl3 Thanks for the pointer, tried a Run method which returns a Task, and managed to get the exception. It would be nice if all Run method variations could return a Task.
Marc Piechura
@marcpiechura
Aug 01 2017 07:47
@ShamsulAmry The return type of the Run method depends on the stream your materializing see http://getakka.net/docs/streams/modularitycomposition#materialized-values
Nick Cuthbert
@ncthbrt
Aug 01 2017 09:05
Anyone know the best way to approach this problem: I have a set of entities which are identified by a sequential id in the database layer. I need to choose a hash function for them so that ConsistentHashRouting evenly distributes the entities across nodes, keeping in mind that access patterns are going to be over relatively small ranges of entities at a time.
Nick Cuthbert
@ncthbrt
Aug 01 2017 09:20
Or am I misunderstanding how consistent hashing works, and a sequence is exactly what you want as in this diagram
fleed
@fleed
Aug 01 2017 12:12

Hello

What's the right way of handling async/await operations in a PersistentReceiveActor? No overload of the Command<MessageType> method accepts Tasks. I'm currently using Nito.AsyncEx to run async tasks synchronously... but I'm not a fan of this solution. Any suggestion?

Nick Cuthbert
@ncthbrt
Aug 01 2017 12:12
@fleed You can tell yourself with an async task
Which when completed would be dequed
fleed
@fleed
Aug 01 2017 12:13
@ncthbrt do you mean something like using this.Self.Ask<>?
Nick Cuthbert
@ncthbrt
Aug 01 2017 12:16
No
fleed
@fleed
Aug 01 2017 12:16
maybe using PipeTo?
Nick Cuthbert
@ncthbrt
Aug 01 2017 12:16
Well that also
fleed
@fleed
Aug 01 2017 12:17
something like: this.DoMyOperationAsync(message).PipeTo(this.Self)?
Nick Cuthbert
@ncthbrt
Aug 01 2017 12:17
Yes
Exactly
fleed
@fleed
Aug 01 2017 12:17
looks a better approach... thank you!
HansVanderGucht
@HansVanderGucht
Aug 01 2017 12:20
akka remote and DNS resolve ? I have a AKKA server with hostname : 0.0.0.0 and public-hostname = "mypcname". On the client, I put the IP adress a connection name for the actorselection => doens't work ( drop for non-local recipient ). If I put the public hostname it works. Can't AKKA resolve IP & DNS ?
Marconcilio
@MarconcilioSouza
Aug 01 2017 12:21

Hi, I would like information about akka involving reactive programming,
Is there any concrete mechanism used like the Observer? That accompanies what is happening? I saw the concept of author it addresses the same concept?

Https://en.wikipedia.org/wiki/Observer_pattern

Sorry if I wrote something wrong, I'm using google translator
Nick Cuthbert
@ncthbrt
Aug 01 2017 12:31
@MarconcilioSouza Akka.Net
Has a concept called streams
Which are similar
Marconcilio
@MarconcilioSouza
Aug 01 2017 12:33
@ncthbrt , Thank you, I'll read it here.
Nick Cuthbert
@ncthbrt
Aug 01 2017 12:34
@object has a nice talk on them
Arjen Smits
@Danthar
Aug 01 2017 12:40
@HansVanderGucht Akka can resolve IP & DNS
but thats not whats going on here
the public-hostname becomes part of the addressing scheme in your actor system
so myactorsystem@mypcname
that becomes part of the actorpath and thus part of the identifying part of an actor
if your then try to communicate directly on the ip, thus changing the path to: myactorsystem@10.10.10.10
from a network point of view, that would work
however from an actorsystem point of view, that would be an entirely different thing
HansVanderGucht
@HansVanderGucht
Aug 01 2017 12:42
My server is listening on Remoting started; listening on addresses : [akka.tcp://GuardMain@mylaptop:9899]. The client does a actor selection with a name that's configured. When I use mylaptop => OK, when I use the IP adress => doesn't work
Arjen Smits
@Danthar
Aug 01 2017 12:43
so if you then try to communicate using that actorpath
first an attempt is made to establish an association
so your actor system gets a message for myactorsystem@10.10.10.10, and it then basically says: Nope that aint me. I am myactorsystem@mypcname. Bye byue
and the association is refused
its would be the same as me trying to talk to you, calling you Piet, instead of Hans. :P
You'd still hear me, but refuse to answer all the same :P
Arjen Smits
@Danthar
Aug 01 2017 12:57
And silence ensues... Well, the irony of that is not lost on me ^^ :D
Ilya Komendantov
@IlyaKomendantov_twitter
Aug 01 2017 14:49

System = ActorSystem.Create("system");
var materializer = ActorMaterializer.Create(System);
var readJournal = PersistenceQuery.Get(System).ReadJournalFor<SqlReadJournal>("akka.persistence.query.journal.sql");

System.ActorOf(Props.Create(() => new ViewActor(readJournal, materializer, "Persistent1")),"ViewActor1");
System.ActorOf(Props.Create(() => new ViewActor(readJournal, materializer)),"Persistent2")),"ViewActor2");
System.ActorOf(Props.Create(() => new ViewActor(readJournal, materializer)),"Persistent3")),"ViewActor3");

Is that OK to send readJournal and materializer to actors? Or I need to create them inside actors?

Aaron Stannard
@Aaronontheweb
Aug 01 2017 14:56
@HansVanderGucht are you changing the actor selection when you also change the binding address?
@eddadjei use Coordinated.Shutdown when you terminate a node
that will run the graceful leave process correctly
and will also explicitly create time to allow a singleton to move
killing a process running an Akka.Cluster node should automatically invoke CoordinatedShutdown
but I've seen in instances where people are using Topshelf that the kill signal CoordiantedShutdown intercepts gets overridden
so you might have to explicitly call it
like this
Bartosz Sypytkowski
@Horusiath
Aug 01 2017 16:51
@IlyaKomendantov_twitter I think you'll be ok with that, but you should try it to be sure for 100%