Giter Site home page Giter Site logo

thembisilengq / akkatecture Goto Github PK

View Code? Open in Web Editor NEW
524.0 37.0 54.0 1.78 MB

a cqrs and event sourcing framework for dotnet core using akka.net

Home Page: https://akkatecture.net

License: MIT License

C# 97.46% PowerShell 0.06% Shell 0.53% F# 1.93% Batchfile 0.02%
akka cqrs event-sourcing event-driven netstandard domain-driven-design ddd cqrs-pattern dotnet-core csharp

akkatecture's Introduction

  • 👋 Hi, I’m @ThembisileNGQ
  • 👀 I’m interested in ...coding for my various start up ideas in particular the health and fitness space
  • 🌱 I’m currently learning ...Full stack engineering (At the JS stage)
  • 💞️ I’m looking to learn coding to fulfill a dying wish
  • 📫 How to reach me ...email address is [email protected]

akkatecture's People

Contributors

4deeptech avatar dagilleland avatar damian-p avatar dependabot-preview[bot] avatar dependabot-support avatar dependabot[bot] avatar lutando avatar malclear avatar malclear-sh avatar siudeks 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

akkatecture's Issues

Configuration Story

How to Bootstrap Akkatectures opinionated defaults from Config to be used by The ActorSystem

Event sourcing behaviour for loading sourced events

Related to #2

Desired Behavior for Sourcing Events:

Apply sourced AggregateEvent to AggregateState
AggregateRoot should be unable to receive new commands while is sourcing events (when IsRecovering=true) ie all commands sent while recoving should be kept in the mailbox/queued and only processed when IsRecovering done.

cluster - docker - akkatecture - asp.net core

How can i subscribe to domain events from multiple docker containers? I think I need to use DistributedPubSubMediator on local event? What's your advice?

Example
ApiService - docker (Send command to OrderService)
OrderService - docker (Listen CreateOrderCommand, start saga)
PaymentService - docker (Listen OrderCreated saga event)
EmailService - docker (Listen OrderCompletedEvent )
SmsService - docker (Listen OrderCompletedEvent )

DDD -> entity is not a valueobject

Why is entity in akkatecture a valueobject? I would assume it could inherit from identity (to be identity itself… but can be composed, too). What I don't get in line with is the fact that it is here a valueobject. Any (I assume technical) reason to do so?

Sample with Subscribers

Do you have any examples that make use of a DomainEventSubscriber? It's unclear to me how to wire a typical way using DI.

Specifications and type for failure reasons

Hi Lutando,
I'm seeing that the "errors" parameter for the FailedExecutionResult has changed from an IEnumerable<string> to string[]. However, the type returned from WhyIsNotSatisfiedBy(T obj) in the Specification<T> class remains IEnumerable<string>. It is requiring that we now add ".ToArray( )" to our calls.
Was this intentional?

... new FailedExecutionResult(ourSpecification.WhyIsNotSatisfiedBy(command).ToArray());

Not a major issue, I think.

Cluster DomainEventSubscriber

Hi. Is the cluster singleton code for domaineventsubscribers unfinished?
It seems as though you need to use a DistributedPubSubMediator to do PubSub in a cluster. And I dont see that in your code. No tests either.

It does not work for me and reading about distributed PubSub in the AKKA.NET docs lead to believe the code in Akkatecture is not complete for this functionality.

Identity ValueValidation suggestion

I'm wondering if the validation for Identities might be relaxed some. The current Regex starts with "^[a-z0-9]+....". Could underscores be allowed: such as this "^[a-z0-9_]+...."?
This would allow for Identity constants, declared in code, to be more descriptive/easily identified.

Cluster Testing

We lack the testing for Akkatecture.Clustering

Need to research how multi node test kit works.

Release Workflow

dev branch -> build to nuget prerelease, no need for github release
master branch -> build to nuge, needs github release

[Discovery] - Sagas

To leverage the strengths of hierarchical actor systems I would like to apply the SagaAggregateManager => Saga hierarchy pattern.

The general pattern that would be best (at its core) would be to have a SagaManager subscribe to at least the event that starts the saga. It will then spawn a child actor which will run as its own saga with its own internal state, and if necassary, the Saga can Emit a completed event to the domain. This much is true but there are two diverging strategies to make this work in Akka.

Strategy 1

Have the SagaManager subscribe to all DomainEvents it needs to do its coordination and issue those events to its child actor so that the child actor can apply those events to its internal state. This means that for any given event subscribed by the manager, it will push them to its child

Strategy 2

Have the SagaManager subscribe to only the DomainEvent (the sagas initiating event) and then instantiate the child actor with this and leave the child actor with the task of handling received events from various aggregate roots. This means that all commands issued by Sagas must have some form of location transparent address IActorRef eg.

Concerns

Long running sagas happen to have lifespan that spans deployments of clusters/shards, how can we guarantee that the location transparent addresses are going to work whenever they are used? Maybe persistent child actors have to be used, and the SagaLocators can just point to the SagaManager so that akka persistence can rollup state.

Let me sleep on this.

Batch processing

Does Akkatecture provide for the ability to do batch data import processing? For example, if my application was importing a bulk export from another platform, instead of processing these as 'one command at a time' does Akkatecture allow for creating the domain event journal events in a faster batch process ?

Update on missing feature and other enquires

I’d been playing around with this framework and its awesome in the sense that it solves a lot under the hood. However, I have a few questions and enhancements proposal. I will be happy to contribute for the same as well.

How to implement domain services and anti-corruption layer in this framework. Often we deal with operation the don't fit in the aggregate root and also integrate/extend legacy and third parties' code. An example showing the implementation of domain services and anti-corruption layer would be really handy. This can potentially be part of the framework as first-class citizens and enrich the framework.

How can we rehydrate the aggregate root at the point when its required (lazy rehydration) or on-demand rehydration rather than keeping in-memory persistent actor as a child of the manager? This will potentially reduce memory footprints. This can perhaps be made configurable in the Akkatecture config,

Finally, any updates/plan on the missing following features:
• aggregate state snapshotting
• scheduled jobs

Add quality badges to README

Hi @Lutando

What about to add some Sonar (or alternative) support to build process so that to have Sonar qualit badges in main README file? Also code coverage should be included as well

What is your opinion about keeping code quality at high level with some support from tools?

MIT license violation

Large parts of this project is violating the MIT license of EventFlow. Please make sure to rectify this and make sure to add links back to the original project which under copyright from myself and eBay Software Foundation.

The original project of which most of the code has been copied is located here.
https://github.com/eventflow/EventFlow

Akka.CQRS Comparison

I am more curious than anything else. Feel free to close this issue if it doesn't create constructive conversation.

Have you had an opportunity to look at the Akka.CQRS reference architecture (https://github.com/petabridge/akkadotnet-cluster-workshop) that @Aaronontheweb and the Petabridge team recently created for their Akka.NET training tour? If so, how does the CQRS architecture facilitated by the Akkatecture framework compare (and contrast) to Petabridge's example?

Event sourcing behaviour for committing emitted events

Right now events are stored using the standard Akka deserializer (default is Hyperion IIRC)

We want to store our events as clean json so that we do not tie our events to a runtime or particular serializer since this limits the amount of applications that can consume these events, this is the motivation for storing the events as clean json to be as agnostic as possible.

Desired Behavior for Committing:

Aggregate Root Emits an AggregateEvent
Commit AggregateEvent
AggregateEvent gets applied to AggregateState**
Create DomainEvent from AggregateEvent
Publish DomainEvent
** Should AggregateEvent application happen before or after AggregateEvent Commit?

Metadata Extensions

Commands might need IMetadata fields to carry some related metadata for the command.

When commands result in events and events result in commands we need to map correlation and causation identifiers appropriately in this extension.

Motivation for the latter statement here

Why does an aggregate need to be aware of snapshotting?

I am curious why snapshotting was designed the way it was. It seems to me this should be a configuration option that is invisible to application code. It's purely a technical optimization. Isn't it just serialized state object with a version? Rehydrate, replay from that version to the current version.

Is there something I am missing?

Investigate using Nodatime for any date/time functionality

Hi,

Having looked at this project (and really liking it), I noticed that the datetimeoffset type is used when representing the time passed since the Unix epoch.

As someone who is pretty fanatical about correct time representation and testing, I wondered whether you would consider switching to Nodatime. This would give you a type (Instant) that represents the time in UTC and therefore devoid of any timezone information as well as a clock representation that can be either mocked or have a fake representation injected that allows the manipulation of time during tests.

If this would be something you'd consider, I'm happy to put a proof of concept/PR together.

Thanks for the good work, it is really a time saver.

Sean.

Typed Actor Reference Extensions

It might be beneficial to have typed actor references within the domain system to ensure compile time conformance to commands sent via the AggregateManagers and other things.

Will need a similar one for sagas wrt domain events

Comprehensive Example

Comprehensive example that uses everything that akkatecture offers

Needs:
Api Client that proxies into the cluster
WebSocket Server ?
Websocket Client ?
Clustered Worker
Clustered Seed

cluster example unhandled RecoveryCompleted

[Thread 0005][[akka://akkatecture/system/sharding/UserAccountAggregateManager/6/useraccount-f5d25698-1584-43c3-89e2-8ae37a23cc88/useraccount-f5d25698-1584-43c3-89e2-8ae37a23cc88#432279842]] Aggregate with Id 'useraccount-f5d25698-1584-43c3-89e2-8ae37a23cc88 has received an unhandled message RecoveryCompleted

Support Serializable Creators and Messages

akka,actor{
    serialize-messages = on
    serialize-creators = on
}

Breaks some of the unit tests, might need to do some digging into how it works. Will be crucial for remote deployment/clustering scenarios probably. TBD

Support for Jobs

Job support for doing usually side effects or work needs to be done

Job manager should forward to the correct job actor and the job should spawn actors based on some routing mechanism(roundrobin etc)

This will be used for things like sending emails, smses, dumping raw dating somewhere, things of that nature

Documentation

Preliminary Documentation

  • "Hello World"
  • Design Decisions
  • How-To Basics

Full API example

Full API example showing how to segregate API application from the backend worker service and how they interact with each other would be helpful

RFC - Scheduled Jobs

In this issue we discuss the scheduled jobs api and mechanics. The scheduled jobs feature came after 0.5.0.

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.