Git Product home page Git Product logo

akkacqrs's Introduction

akkacqrs's People

Contributors

horusiath avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akkacqrs's Issues

Checking for termination

In the line 74 of AggregateCoordinator, there is a check for the terminated message. I can presume why there is a check, because the actor has to be removed from the list.

But I don't know why there is a check for pending commands from line 81 that done inside the block. Shouldn't the actor be recreated anytime there is a command for an actor and if it does not exist? In that case, shouldn't the code be from 81 to 91 outside of the if block as shown below?

     protected override bool Receive(object message) 
     { 
         var terminated = message as Terminated; 
         if (terminated != null) 
         { 
             // if Terminated message was received, remove terminated actor from terminating children list 
             _terminatingChildren.ExceptWith(new[] { terminated.ActorRef }); 
          }
         else 
         {
             // if there were pending commands waiting to be sent to terminated actor, recreate it 
             var groups = _pendingCommands.GroupBy(cmd => cmd.PersistenceId == terminated.ActorRef.Path.Name).ToArray(); 
             _pendingCommands = groups.First(x => !x.Key).ToList(); 
             var commands = groups.First(x => x.Key); 
             foreach (var pendingCommand in commands) 
             { 
                 var child = Recreate(pendingCommand.AggregateId, pendingCommand.PersistenceId); 
                 child.Tell(pendingCommand.Command, pendingCommand.Sender); 
             } 

             return true; 
         } 

         return false; 
     } 

Withdrawal method

I think the method PatchWithdrawal should return an object which should contain the account and balance. Or another GET method to return an account which shows the balance.

Code snippet: public async Task PatchWithdrawal(Withdraw request)

Do you have any thoughts on where to incorporate this?

Router Vs Coordinator

In the extension.cs, a router has been used for userindex actor. Is there a reason why the other coordinators like account and user have not been used in a router but as an actor only?

ReceiveRecover and IEvent

First of all, I want to say that this is an awesome example that I have seen in the area of CQRS with AKKA.NET.

In lines 64 to 67 in the ReceiveRecover method, I see that ReceiveRecover can get an event other than the SnapshotOffer and it will update the state. I don't see a case that can happen other than it receives an event like RecoveryCompleted which should not update the state.

Could you please clarify when it is necessary to update the state in a ReceiveRecover method?

Extension

I have seen the pattern of extending a class through inheritance by deriving the class from a base class of similar type. For example, in WebAPI a CustomerController is derived from APIController. The class Extension and ExtensionProvider has confused me. To me, it is more like configuring a run time object but the name Configure would have been more appropriate?

Could you please explain the CqrsExtension achieved with InjectTopLevelFallback?

Monitoring

While I'm running the application locally, I don't see any response after this line

child.Forward(command);

The sign up page returns with a 500 Internal Server Error and simply don't proceed from there.

I noticed that monitoring is integrated with the application. But I don't see any logs in the Visual Studio output window neither any logs in the BIN or OBJ folder.

Could you please let me know if I have to install any special software like Kamon and Stasd to see the logs?

akkacqrslog

I updated the HOCON to the following. I still don't see any logs in the output window:

  <akka>
    <hocon>
      <![CDATA[
        akka {
          loglevel = DEBUG
          loggers = [ "Akka.Logger.Serilog.SerilogLogger, Akka.Logger.Serilog" ]
          actor {
            autoreceive = on
            lifecycle = on
            fsm = on
          }
        }
      ]]>
    </hocon>
  </akka>

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.