Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • Dec 07 11:49
    IgorFedchenko commented #4085
  • Dec 07 10:31
    IgorFedchenko commented #4085
  • Dec 07 08:36
    IgorFedchenko commented #4085
  • Dec 06 20:57
    IgorFedchenko commented #4085
  • Dec 06 20:32
    IgorFedchenko commented #4085
  • Dec 06 20:01
    IgorFedchenko commented #4085
  • Dec 06 19:55
    IgorFedchenko commented #4085
  • Dec 06 16:22
    Aaronontheweb labeled #3997
  • Dec 06 16:22
    Aaronontheweb closed #3997
  • Dec 06 16:20
    IgorFedchenko commented #3997
  • Dec 06 16:08
    IgorFedchenko commented #4085
  • Dec 06 15:50
    Aaronontheweb assigned #4085
  • Dec 06 15:50
    Aaronontheweb labeled #4085
  • Dec 06 15:50
    Aaronontheweb labeled #4085
  • Dec 06 15:49
    Aaronontheweb closed #4032
  • Dec 06 14:58
    IgorFedchenko commented #4032
  • Dec 06 14:57
    IgorFedchenko opened #4085
  • Dec 05 17:21
    Aaronontheweb synchronize #4079
  • Dec 05 17:20
    Aaronontheweb labeled #4084
  • Dec 05 17:20
    Aaronontheweb labeled #4084
Roy van Kaathoven
@Rovak
@Horusiath the framework uses multiple Ninject containers, and afaik the ActorSystem can only have 1 DI container
Onam
@OnamChilwan
@Horusiath ah right so for unit testing actors simply don't use TestKit?
Stick to basic unit testing and assert agianst behavior as opposed to asserting messages have been published etc as this will be covered from integration tests via Testkit
Bartosz Sypytkowski
@Horusiath
@OnamChilwan I would faster forget about unit testing, than testkit specs ;) This image well describes sense of testing components working together in isolation:
@Rovak don't get me wrong, I really don't want to offend anybody here, but don't all those issues point to some complexity problems on your company app side?
Bartosz Sypytkowski
@Horusiath
@aachinfiev you could have one centralized config provider service (i.e. zookeeper, consul) that you could ask for configuration before starting an actor system
then simply retrieve actual config for current service from it
Roy van Kaathoven
@Rovak
@Horusiath no offence taken, the app is indeed pretty complex, its an enterprise service bus. The app may load multiple projects and these projects should never be allowed to share instances like repositories, database connections, services etc. so each project has their own ninject container. Right now some services which do work in different threads have locks which i want to replace with actors and message passing
there are a LOT of services, and i can't rewrite everything at once. So i want to create a migration path which may not look pretty in the beginning, but i can then slowly refactor everything to akka actors
Zetanova
@Zetanova
@Horusiath I am still at actor pattern, my current problem is that before i had the same state-model-type for the AR-state and for the read-model. Now i am changing that the AR is using his own State-type. The problem is that the Sender of the create-command shouled be informed with the newly created read-model. I have the idea, to pass a non-persitent event to the EventBus so that the ReadModelProjector can tell the Sender of the create command the entity
But it seams wrong
Roy van Kaathoven
@Rovak
I tried a different approach where the factories now build Props instances instead, which seems to work fine.
Bartosz Sypytkowski
@Horusiath
@Rovak this or returning Expr<ActorBase> could work
@Zetanova the view side of persistence plugin is lacking some features. That's why it was obsoleted on the jvm side in favor of persistence queries (which we will probably done too, once streams and persistence query will be ported). Btw. this idea with using third mediator seems neat to overcome current limitations.
Zetanova
@Zetanova
@Horusiath readmodel generation is working good, the batching is easy and working well. The buffer of events will be flushed on MaxEventCount and Timeout in a single actor for each AR-type. The events are then grouped by Id and each group is processed by the normal Read-Modify-Update CRUD pattern.
triggered by a special event, I could send the readed read-model back to a requestor,
The other option would be the normal one that the client is generating the read-model internaly on client-side and sends only the create-command, without getting the model back.
but then there is a lag, where one client-component has the read-model and maybe an other need it to be created on the read-side (some query)
Zetanova
@Zetanova
It happens in the UI, after create of some entity the user is moved to the entity-list that need to be refreshed. Of course the possibilty is to inject the client-side created entity into the list, but the "server"-side sorting and paging will be broken
Chris Martin
@trbngr
hello, strangers!
Onam
@OnamChilwan
@Horusiath is it fair to say then it isn't possible to truly unit test an actor in isolation?
Bartosz Sypytkowski
@Horusiath
@OnamChilwan you could do so, ie. by passing children Props through actor's constructor (this is done in few cases) or as part of some message to be send at some point in time. But if those are making a solution too complex, then it's a warning, that maybe a hierarchy of actors should be changed or maybe they are so tightly coupled, that they should be tested as one.
Onam
@OnamChilwan
Yeah I was thinking that was one option however whilst I was doing this it felt wrong. Thanks for the info, it just seemed from the articles I've read seems a little misleading when they say unit testing
to11mtm
@to11mtm
I have a question regarding scheduling; If An actor is created, and hangs such that it never returns, will it 'lock' the thread on the thread-pool such that another thing cannot consume it?
Arjen Smits
@Danthar
@to11mtm you mean if it hangs while processing a message ?
If you block a receive handler. Then it will 'block' a thread on the threadpool. (if it will actually block/lock the thread that was running at that time, depends on your code ofcourse, if your doing async await things, it might not)
to11mtm
@to11mtm
@Danthar : public SampleDatabaseQueryActor()
{
Receive<IQueryParameters>(param => PerformQuery(param)); // If PerformQuery somehow has an internal deadlock.
}
Arjen Smits
@Danthar
ah yep that would do it
but if your doing a query, and it deadlocks, wont your dbdriver throw an exception of some kind ?
either way, there is no magic code in the Akka.Net dispatchers that prevents these kind of problems. It needs to adhere to the normal set of rules regarding the TPL like anything else.
Akka.net makes concurrency easier to implement, and prevents alot of the pitfalls that come with the territory. But its not perfect ;) (nothing is)
Christian Duhard
@cduhard
hmm is there a straight forward way to know when all watched children are stopped?
This feels kinda ugly while (Context.GetChildren().Any(x => x.GetType() == typeof (Account)))
to11mtm
@to11mtm
Truth!
Is there a good way to 'monitor' for a deadlock in cases like this? Perhaps configuring the dispatcher's deadlines
Bartosz Sypytkowski
@Horusiath
@cduhard Context.Watch?
Christian Duhard
@cduhard
they are watched
Bartosz Sypytkowski
@Horusiath
you can create counter to increment once child of specific type is created, and decrement it on Terminated
Christian Duhard
@cduhard
yeah, that's an option. what I would like to do is implement sagas like you did in your latest Cqrs app
then I wouldn't have this complex graceful shutdown problem
Bartosz Sypytkowski
@Horusiath
"someday" I will find time to finish it
Christian Duhard
@cduhard
thats what's making this harder than it should be. i have to wait for sagas to playout inside my aggregates
i have to cut off incoming messages and lets everything passivate, it shouldn't be hard but it is tricky to keep it simple and foolproof
Christian Duhard
@cduhard
@Horusiath "someday" soon I hope
Bartosz Sypytkowski
@Horusiath
there is a huge load of stuff to finish, but I hardly have any time to work on akka from over a month
Christian Duhard
@cduhard
job getting in the way?
Bartosz Sypytkowski
@Horusiath
yes. Well, at least it's interesting
Alex Valuyskiy
@alexvaluyskiy
This message was deleted

@Horusiath, I've been trying Akka.Streams, and I have couple of questions. For example I have this Scala code

  override def eventsByTag(tag: String, offset: Long = 0L): Source[EventEnvelope, NotUsed] = {
    Source.actorPublisher[EventEnvelope](EventsByTagPublisher.props(tag, offset, Long.MaxValue,
      refreshInterval, maxBufSize, writeJournalPluginId)).mapMaterializedValue(_ ⇒ NotUsed)
      .named("eventsByTag-" + URLEncoder.encode(tag, ByteString.UTF_8))
  }

1) What should I use, instead of NotUsed? Unit/Unit.Instanse or something else?
2) I should return Source<EventEnvelope, Unit>, but method "Named" returns IGraph<SourceShape<EventEnvelope>, NotUsed>. How to convert SourceShape<T> to T?

Marc Piechura
@marcpiechura
@alexvaluyskiy yep we are using Unit as NotUsed