Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 12:39
    nagytech synchronize #4148
  • 12:27
    nagytech synchronize #4148
  • 04:57
    Aaronontheweb synchronize #4106
  • 02:45
    Aaronontheweb synchronize #4106
  • 02:43
    Aaronontheweb synchronize #4106
  • 02:30
    Aaronontheweb synchronize #4106
  • 00:24
    Aaronontheweb synchronize #4106
  • Jan 20 23:41
    Aaronontheweb opened #4150
  • Jan 20 22:07
    Aaronontheweb synchronize #4106
  • Jan 20 21:57
    IgorFedchenko synchronize #4126
  • Jan 20 21:32
    Aaronontheweb commented #4126
  • Jan 20 21:28
    IgorFedchenko commented #4126
  • Jan 20 21:24
    IgorFedchenko synchronize #4126
  • Jan 20 21:23
    IgorFedchenko synchronize #4126
  • Jan 20 21:09
    dependabot-preview[bot] labeled #4149
  • Jan 20 21:09
    dependabot-preview[bot] opened #4149
  • Jan 20 21:09

    dependabot-preview[bot] on nuget

    Bump Hyperion from 0.9.11 to 0.… (compare)

  • Jan 20 20:45

    Aaronontheweb on 1.3.17

    (compare)

  • Jan 20 20:44

    Aaronontheweb on master

    Bump AkkaVersion from 1.3.14 to… Bump Microsoft.NET.Test.Sdk fro… Bump System.Data.SqlClient from… and 11 more (compare)

  • Jan 20 20:44
    Aaronontheweb closed #134
foo bar code
@lepinay
trying to create a TraceLogger for akka, so far I've updated my config with: loggers = ["AkkaExtensions.TraceLogger, AkkaExtensions"], referenced the assembly where needed but I still get an Akka.Configuration.ConfigurationException: Logger [AkkaExtensions.TraceLogger, AkkaExtensions] specified in config cannot be loaded: System.ArgumentException: Unknown actor producer [AkkaExtensions.TraceLogger]...is there any additional step ?
Graeme Bradbury
@GraemeBradbury
okay so I now understand Fake a smidgen better.
build multinodetests spec-assembly=remote
what's the opinion on the commanline arg spec-assembly?
obvious enough that it's a filter?
Suhas Chatekar
@schatekar
this runs the tests and not builds them?
Graeme Bradbury
@GraemeBradbury
yeah
foo bar code
@lepinay
ok, works if custom logger inherits from ReceiveActor, I think the doc online should explain this because the error message isn't clear...it sounds like akka can't find the type/assembly but it's actually that the type is there but doesn't inherit receiveactor or any proper base type that should be there for a custom logger
Suhas Chatekar
@schatekar
@GraemeBradbury not sure if you would like to say build in the beginning in that case
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)