These are chat archives for akkadotnet/akka.net

21st
Jul 2016
to11mtm
@to11mtm
Jul 21 2016 01:44

@Aaronontheweb looking at your code for the MySQL insert statement and the SQLite insert statement, I'm correct in stating it's supposed to be an upsert, yes?

(BTW, looking at the MySQL Implementation, your update statement is not updating the Manifest value whereas the SQLite version is. That may cause some issues.)

Aaron Stannard
@Aaronontheweb
Jul 21 2016 03:37
I didn't write either of those - just a user :p
to11mtm
@to11mtm
Jul 21 2016 03:45
lol fair enough, I'm running on project deadline sleep
Aaron Stannard
@Aaronontheweb
Jul 21 2016 03:45
cc @Horusiath @alexvaluyskiy they're the right dudes to talk to about that
to11mtm
@to11mtm
Jul 21 2016 03:55

Indeed. I've got a couple other questions for them as well, but I've finally dealt with all of Oracle's hilarity. Thanks again for letting me know the other repo was updated, that did help a bit.

The cringe of my day; most reliable/efficent way to duplicate the upsert in Oracle appears to involve insert->exception->update.

Jared Lobberecht
@Jared314
Jul 21 2016 04:36
Can a PersistentView be initialized to the current journel "head" without running a recovery? I can send the journel a ReadHighestSequenceNr and set the LastSequenceNr property with reflection. But, I don't see an official way to do it.
Alex Valuyskiy
@alexvaluyskiy
Jul 21 2016 06:07
Garrard Kitchen
@garrardkitchen
Jul 21 2016 06:08
Thanks @Aaronontheweb
Ricky Blankenaufulland
@ZoolWay
Jul 21 2016 06:39
When using switchable behaviors in a ReceiveActor, should I have my initial Become(Idle) in the constructor or in PreStart()? I think PreStart() is better when it comes to restarting the actor (it should reinitialize) but could it happen that multiple Idle behaviours stack because on restart the old ones are not removed?
Bart de Boer
@boekabart
Jul 21 2016 07:13
I'm no expert, but there is very little difference between constructor and PreStart() - both are called in the same situations exactly. It's only bad practice to do anything that can possibly throw an exception in constructor, those are better done in PreStart.
Ricky Blankenaufulland
@ZoolWay
Jul 21 2016 07:17
sure - and the constructor cannot be called on a restart - or is the actual instance removed and a new one created when an actor is restarted?
Arsene Tochemey GANDOTE
@Tochemey
Jul 21 2016 07:17
@ZoolWay PreStart handle stuffs like initialisation for actor states and so on. I think switchable behaviors happened in the methods that help handle messages.
Ricky Blankenaufulland
@ZoolWay
Jul 21 2016 07:22
I was thinking about having a method for the initial Receive<> statements. But maybe they will always be restored/fallback to...
Sergey Kostrukov
@kostrse
Jul 21 2016 08:40
on each restart you get fresh instance of actor, thus code in consitructor called on each restart
PreStart by default called on each restart too... but you can override this logic for PreStart if you want... and use it only as a method which called only once
ollivogel
@ollivogel
Jul 21 2016 10:13
Hi everybody. I have multiple microservices using akka.net cluster and lighthouse. I works fine until I restart a micrososervice. As soon as I restart a service it never reconnects to the cluster again. All I can see in the console is plenty of red Helios expection stuff and dead letters. Is there anything wrong with my hocon?
akka {
stdout-loglevel = DEBUG
loglevel = INFO
      actor {
        provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"             

        serializers {
          wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
        }

        serialization-bindings {
          "System.Object" = wire
        }

        deployment {

        }   
       }

      remote {
        log-remote-lifecycle-events = DEBUG

        helios.tcp {
          transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
          transport-protocol = tcp
          hostname = "127.0.0.1"
          port = 0 
          maximum-frame-size = 1024000b
          tcp-keepalive = on
        }
      }         


      cluster {  
      failure-detector {
            heartbeat-interval = 5s
            acceptable-heartbeat-pause = 10s
        }            

        seed-nodes = ["akka.tcp://Service@127.0.0.1:4053"] 
        roles = ["clientService"]                      
      }
     }
And this is the seed nodes hocon:
lighthouse{
actorsystem: "BetfairServices" #POPULATE NAME OF YOUR ACTOR SYSTEM HERE
}
                akka {
                    actor { 
                        provider = "Akka.Cluster.ClusterActorRefProvider, Akka.Cluster"
          serializers {
            wire = "Akka.Serialization.WireSerializer, Akka.Serialization.Wire"
          }            
          serialization-bindings {
            "System.Object" = wire
          }
                    }

                    remote {
                        log-remote-lifecycle-events = DEBUG
                        helios.tcp {
                            transport-class = "Akka.Remote.Transport.Helios.HeliosTcpTransport, Akka.Remote"
                            applied-adapters = []
                            transport-protocol = tcp
                            #will be populated with a dynamic host-name at runtime if left uncommented
                            #public-hostname = "POPULATE STATIC IP HERE"
                            hostname = "0.0.0.0"
                            port = 4053
            send-buffer-size = 5120000b
            receive-buffer-size = 5120000b
            maximum-frame-size = 1024000b
            tcp-keepalive = on
                        }
                    }            

                    loggers = ["Akka.Logger.NLog.NLogLogger,Akka.Logger.NLog"]

                    cluster {
          gossip-interval = 2s
          refresh-contacts-interval = 5s
                        seed-nodes = [] #manually populate other seed nodes here, i.e. "akka.tcp://lighthouse@127.0.0.1:4053", "akka.tcp://lighthouse@127.0.0.1:4044"
          roles = ["Seed"]

        failure-detector {
          acceptable-heartbeat-pause = 10s
          heartbeat - interval = 5s
          }
                    }
                }
Peter Bergman
@peter-bannerflow
Jul 21 2016 11:20

Reading about Akka.Monitoring in combination with perfmon and custom metrics, in the docs it is mentioned that there might be issues with adding custom metrics to existing categories. https://github.com/petabridge/akka-monitoring#using-performance-counters

In this context, what would a category refer to? Would it be "Akka" or would it be something inside that like "akka.actor"?

Hmm never mind, after thinking about it the category would be "Akka" I guess
voltcode
@voltcode
Jul 21 2016 12:01
@ollivogel try coding the ports for static numbers
a node is considered the same only if it uses the same local port
if you need to juggle them at runtime, use some kind of bootstrapping
ollivogel
@ollivogel
Jul 21 2016 12:01
@voltcode Thanks, will try that.
voltcode
@voltcode
Jul 21 2016 12:02
I'm talking specifically about port = 0
need to change the 0 to somethign constant as 0 means auto assigned at runtime
as you should see it in your logs esp if you turn debug on
voltcode
@voltcode
Jul 21 2016 12:08
also ensure you're on 1.1 version, as previous had problems like #1670
MrR0b0t
@MMrR0b0TT
Jul 21 2016 12:20
Hi all, does anyone know how to configure the Logger to print the full asp.net stack trace when a actor got a exception?
voltcode
@voltcode
Jul 21 2016 12:27
actor can live on a different thread than current asp.net thread - how do you want to connect those stacks?
MrR0b0t
@MMrR0b0TT
Jul 21 2016 12:38
sorry, ignore the asp.net word in my message. I want only the stack
MrR0b0t
@MMrR0b0TT
Jul 21 2016 13:25
@voltcode
Peter Bergman
@peter-bannerflow
Jul 21 2016 13:35
About Akka.Monitoring, is anyone using it with application insights successfully?
Bartosz Sypytkowski
@Horusiath
Jul 21 2016 14:08
@peter-bannerflow I had in my previous work
ilhadad
@ilhadad
Jul 21 2016 14:17
Does wire support the json.net attributes like [JSONIgnore] in objects?
Peter Bergman
@peter-bannerflow
Jul 21 2016 14:22
@Horusiath Alright, do you know the steps required in order to get it up and running? Just create a new app insights resource in azure, generate an API key from the resource, add nuget packages to the project, register the ActorAppInsightsMonitor and then add various metrics to your actors?
Bartosz Sypytkowski
@Horusiath
Jul 21 2016 14:37
@peter-bannerflow basically yes. You just need to remember to use metric plugin methods, not the default logging API
Peter Bergman
@peter-bannerflow
Jul 21 2016 14:39
Ok, you mean like Context.Gauge ?
Bartosz Sypytkowski
@Horusiath
Jul 21 2016 14:39
yes
Peter Bergman
@peter-bannerflow
Jul 21 2016 14:42
Alright, thats what I thought, and then you got the metrics to show up in the metrics explorer in the Azure portal?
Bartosz Sypytkowski
@Horusiath
Jul 21 2016 14:43
yes, at least the last time I've seen them - it was 8 months ago
Damian Reeves
@DamianReeves
Jul 21 2016 14:57
Hey guys. Is an Akka extension a singleton in a whole cluster/remote deployment or just for the local ActorSystem?
Bart de Boer
@boekabart
Jul 21 2016 15:25
No, local
but the extension itself can communicate with its cluster counterparts to 'act' like one...
Damian Reeves
@DamianReeves
Jul 21 2016 15:30
thx
Damian Reeves
@DamianReeves
Jul 21 2016 19:02
Is there any functionality in place to populate a POCO from HOCON?
Jared Lobberecht
@Jared314
Jul 21 2016 19:10
Is Akka.Quartz.Actor published to NuGet? The readme says it is, but NuGet doesn't show it.
Weston
@ronnyek
Jul 21 2016 19:16
incompatible .net framework?
Jared Lobberecht
@Jared314
Jul 21 2016 19:18
the web search says it does not exist
Alex Valuyskiy
@alexvaluyskiy
Jul 21 2016 19:43
Just released Akka.Persistence.Mysql and Akka.Persistence.Redis on nuget
Mysql plugin supports Persistence.Query
Bart de Boer
@boekabart
Jul 21 2016 19:50
Great news, thanks!!
MrR0b0t
@MMrR0b0TT
Jul 21 2016 19:51
Does anyone know how can I configure the Akka.Logger.NLog to print my Stack Trace?
wdspider
@wdspider
Jul 21 2016 20:11
<target name="console" xsi:type="ColoredConsole" layout="[${level}] ${logger}: ${message} ${exception:format=tostring}"></target> is the target I'm currently using during the dev process.
which outputs the exception and the stack trace
Weston
@ronnyek
Jul 21 2016 20:32
I was reading something about distributed actor systems and saw somethign along the lines of actor systems shouldnt handle any part of IO bound operations
like issuing a network request, or writing files or db stuff
didnt know if that was a huge problem, or if that was just general guidelines
(the article also talked about making sure that there still exists the appropriate level of decoupling between the actors themselves and work). Do people solve those problems with IOC, eg, my storage actor might get prepopulated with some data storage provider?
Weston
@ronnyek
Jul 21 2016 20:40
just trying to understand what real world architecture would look like for some of these things
Weston
@ronnyek
Jul 21 2016 21:05
everyone ded
Damian Reeves
@DamianReeves
Jul 21 2016 21:43
So if I use cluster do all of my messages have to be serializable at that point? I have some local only messages which carry around Func<T> delegates and I want to make sure I don't have to can those when I go to cluster
to11mtm
@to11mtm
Jul 21 2016 22:54

I could be totally wrong in this statement, but my guess is that you would just have to make sure that your paths in question (and the ability to traverse them!) is not involving remote at all.

This Issue on the repo touches on it (from a slightly different context): akkadotnet/akka.net#2083

Chris G. Stevens
@cgstevens
Jul 21 2016 23:02
is there an example that I can look at that sends a message from one member to the Singleton Actor?
to11mtm
@to11mtm
Jul 21 2016 23:04

@ronnyek : You want to make sure your blocking IO is separate from the rest of your logic, generally speaking. While a given actor is doing a blocking operation, it cannot handle any other messages. Not the best for efficiency.

Ideally, blocking or similar operations should be handled by their own actors that are separate from other operations. An example is in the diagram showing the hierarchy in the 'webcrawler' service. https://github.com/petabridge/akkadotnet-code-samples/blob/master/Cluster.WebCrawler/diagrams/crawl_service_hierarchy.png You can see that there are actors that specifically handle the blocking download operation and there are a number more of them so that the consumer can keep doing it's thing while those go.

Another potential issue to remember is the limitations of messaging. By that, I mean that you don't want to send more than ~100k in a message, b/c you're going to really piss off your network layer if you ever do remoting. At that point consider streams or some other way to break up the message and reconstruct on the other end.

Weston
@ronnyek
Jul 21 2016 23:22
thats good to know
I am confused about how actors are activated/instantiated
eg, I'm sure akka.net is gonna handle prioritizing and stuff better than I
but how do you parallelize
or control how many instances of x actor can be instantiated at the same time
is that how akka achieves the throughput is lots of really little messages singular when possible?
to11mtm
@to11mtm
Jul 21 2016 23:30
That's the way most distributed systems do.
as for the other stuff
Controlling how many instance of an actor: Routers are good for that in certain circumstances. We actually use those for a one-two punch in our application; we want to have a certain level of 'in-order' parallel processing (i.e. events happening to different objects of the same type, processed more or less in the order we get them) http://getakka.net/docs/working-with-actors/Routers
Chris G. Stevens
@cgstevens
Jul 21 2016 23:32
nevermind... got it working
to11mtm
@to11mtm
Jul 21 2016 23:34

Actors are instantiated ideally at the start of a program, either via code or configuration. There are use cases for actors that are temporarily created (an example; Ask creates a temporary actor to handle throwing the response back to the caller) or potentially character actors.

Some more reading on a related note: https://petabridge.com/blog/top-akkadotnet-design-patterns/