Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 18:03
    Aaronontheweb closed #3760
  • 12:04
    valdisz commented #4071
  • 12:02
    Aaronontheweb labeled #4082
  • 12:02
    Aaronontheweb labeled #4082
  • 12:01
    Aaronontheweb commented #4082
  • 11:58
    valdisz synchronize #4071
  • 11:49
    valdisz synchronize #4071
  • 10:49
    valdisz commented #4071
  • 08:23
    jiyeongj commented #4077
  • 07:46
    Aaronontheweb synchronize #4086
  • 07:45
    Aaronontheweb commented #3887
  • 07:44

    Aaronontheweb on dev

    close #4087 - enable akka.clust… (compare)

  • 07:44
    Aaronontheweb closed #4088
  • 07:44
    Aaronontheweb closed #4087
  • 06:34
    Aaronontheweb labeled #4083
  • 06:33
    Aaronontheweb labeled #4083
  • 06:33
    Aaronontheweb milestoned #4083
  • 06:31
    Aaronontheweb opened #4088
  • 06:31
    Aaronontheweb labeled #4088
  • 06:31
    Aaronontheweb labeled #4088
Graeme Bradbury
@GraemeBradbury
@schatekar currently build multinodetests runs all the tests.
it also has the option build multinodetests spec=blah to supply the -Dmultinode.test-spec bit
Suhas Chatekar
@schatekar
ok, I thought you are talking about the new command line you have built
Graeme Bradbury
@GraemeBradbury
by pointing out -Dmultinode.test-spec you brought some Fake stuff to my attention, which means that my script becomes unneeded.
i can just extend the fake script.
Suhas Chatekar
@schatekar
right
Graeme Bradbury
@GraemeBradbury
ok created a pull request #1265 to extend the fake script.
Bartosz Sypytkowski
@Horusiath
@tstojecki I think, that you registered an event store journal, but you a) didn't specified, that it should be used for a particular persistent actor 2) didn't set it as a default journal
  1. you must override JournalPluginId of the persistent actor to point to journal section in Hocon config like akka.persistence.journal.eventstore
  2. to set journal implementation as default one, you need to add section akka.persistence.journal.plugin = akka.persistence.journal.eventstore
Bartosz Sypytkowski
@Horusiath
and if you want to directly access journal actor, use Persistence.Instance.Apply(system).JournalFor(string.Empty) - string empty will return actor ref for default journal, while i.e. akka.persistence.journal.eventstore will return one you defined as event store
tstojecki
@tstojecki
thanks @Horusiath , you're right, I did none of those
so do i need switch my actors to inherit from PersistentActor rather than ReceiveActor?
This message was deleted
tstojecki
@tstojecki
also, when you say to add a section, to set as a default, you mean to add it to hocon, correct?
journal {
            plugin = "akka.persistence.journal.eventstore"
Suhas Chatekar
@schatekar
I am trying to understand what the following piece of scala code does
val replies: Map[Address, Int] = (receiveWhile(5.seconds, messages = connectionCount * iterationCount) {
          case ref: ActorRef ⇒ ref.path.address
        }).foldLeft(Map(node(first).address -> 0, node(second).address -> 0, node(third).address -> 0)) {
          case (replyMap, address) ⇒ replyMap + (address -> (replyMap(address) + 1))
        }
Any scala experts?
Bartosz Sypytkowski
@Horusiath
@tstojecki yes and yes :) persistent actors need to inherit from PersistentActor (read Persistence docs). And paths I've shown are fully qualified HOCON paths
Bartosz Sypytkowski
@Horusiath
@schatekar receiveWhile is part of the function - it will keep receiving incoming messages as long as all of them matches specified criteria and connectionCount * iterationCount messages has been receive or 5.seconds timeout has been reached. { case ref: ActorRef ⇒ ref.path.address } is actually a very specific lambda, that is called only when input (in this case incoming message) is ActorRef - if it is, lambda returns ref.path.address, else unhandled will occur and receiveWhile will end. As result of the whole, a sequence of addresses will be return. Then we have foldLeft method, which is basically equivalent of Aggregate method from LINQ. It takes initialized Map(node(first).address -> 0, node(second).address -> 0, node(third).address -> 0)) as first element (it a dictionary with 3 key-value pairs where keys are addresses on first, second and third node and all values are 0). Then aggregation lambda { case (replyMap, address) ⇒ replyMap + (address -> (replyMap(address) + 1)) } which increments a counter for each address in map.
tl;dr it will receive up to connectionCount * iterationCount ActorRef messages for 5 seconds, and then count them by their nodes addresses giving map of addres->count as the result
Aaron Stannard
@Aaronontheweb
@james-andrewsmith I'm working on a NuGet package for this, but I recommend a token bucket throttler
every account gets their own Token bucket
that gets periodically refreshed - like once per hour, up to some maximum number of tokens
every time the user makes an API call, you take a token out of the bucket
once the bucket is empty, the user can no longer make any API calls
does that concept make sense?
@lepinay we already have a trace logger
(although it's probably not in the docs... so my bad on that)
getting a HOCON sample...
Aaron Stannard
@Aaronontheweb
akka {
            loggers = ["Akka.Event.TraceLogger, Akka"]
            loglevel = "ERROR"
}
@emilingerslev you can start a cluster with no needs, but you will have to perform manual joins
the seed nodes are there to help automate the formation / join process
Suhas Chatekar
@schatekar
@Horusiath Is replyMap in the lambda of foldLeft is the map returned by the first lambda on which foldLeft is called)?
Aaron Stannard
@Aaronontheweb
@joecojabba we cover this in detail in Petabridge's design patterns training, but the correct answer is that if your actor has a longer lifespan than the dependency it takes (like a database connection) then the actor has to be responsible for fetching / replacing that dependency
so the actor can take a factory method (Func<Neo4JClient> generator) in its constructor or call a static factory somewhere if necessary
the other option is to make it so the actor's lifespan matches the lifespan of the dependency
but you can pay a hefty price when it comes to performance and consistency if you do that - much better to have a long-lived actor that can refresh its db connection
Bartosz Sypytkowski
@Horusiath
@schatekar it this case replyMap is accumulated value. Since in your example immutable map is used, when your calling replyMap + (address -> (replyMap(address) + 1)) you're actually returning new map instance with updated key-value pair. This map is then moved as replyMap to the next iteration of foldLeft
(address -> (replyMap(address) + 1)) is Scala equivalent of C# new KeyValuePair<Address, int>(address, replyMap[address] + 1)
Ivan R. Perez
@irperez
@Aaronontheweb Just a simple reminder to release the nuget package with my bug fix for the Akka.Monitor.PerformanceCounters. Thanks again!
Aaron Stannard
@Aaronontheweb
@irperez petabridge/akka-monitoring#19
waiting on TC to give me a nice green checkmark
then I'll release it
Bartosz Sypytkowski
@Horusiath
did you know that Polish violinist made a song with familiar title :) https://www.youtube.com/watch?v=6Udold4Pj6s
Aaron Stannard
@Aaronontheweb
hehe
Suhas Chatekar
@schatekar
it is nice though
Bartosz Sypytkowski
@Horusiath
yes, nice indeed
Aaron Stannard
@Aaronontheweb
@rogeralsing I had an idea I wanted to run by you