/akka-ddd

Akka/EventStore DDD framework

Primary LanguageScalaMIT LicenseMIT

akka-ddd Build Status Version

Join the chat at https://gitter.im/pawelkaczor/akka-ddd

Reusable artifacts for building applications on top of the Akka platform following CQRS/DDDD-based approach.

Used by: DDD Leaven Akka Ver 2

Modules overview

akka-ddd-messaging

Dependencies

Contains base types for commands and events and their envelopes ( command/event messages ). This module should be used on both write and read side of the system.

akka-ddd-core

Dependencies

Contains core artifacts used on write side of the system:

  • AggregateRoot trait - abstract persistent, event sourced actor responsible for processing commands received from the office. Implementation of AggregateRoot trait represents concrete business entity (i.e Reservation, Product, etc) See example AR: Reservation

  • Office - an actor that is used by the client to talk to Aggregate Roots of a particular class. See Don't call me, call my office for explanation. There are two office implementations: "simple" (used for testing) and "global" / distributed (implemented using Akka Sharding)

  • Receptor - allows one office to react on events occurred in another office. Receptor is capable of filtering input events received from configured event stream, transforming them into arbitrary output messages and routing output messages to configured fixed or dynamic (derived from the message) destination. To make configuration of these capabilities straightforward ReceptorBuilder provides simple DSL. Here you can find an example configuration of typical receptor that receives event from one office and sends command to another office. Actual logic of reading events from event stream is pluggable - EventStreamSubscriber must be mixed into Receptor class. Ready to use EventstoreSubscriber is provided by eventstore-akka-persistence module.

  • Saga / Process Manager - implementation of Saga / Process Manager pattern. See: Saga - big picture. See example Process Manager: OrderProcessManager

eventstore-akka-persistence

Dependencies

Incorporates Akka Persistence journal and snapshot-store backed by Event Store. Registers JSON Serializer as Akka custom serializer for akka.persistence.PersistentRepr (wrapper class that is used by Akka Persistence to store event in the journal). Json format is natural choice for Event Store as it enables creating user projections using javascript directly in Event Store. Provides also EventstoreSubscriber that should be mixed into the Receptor (available in akka-ddd-core).

akka-ddd-scheduling

Dependencies

Provides durable scheduler (backed by Event Store!) that is typically used by Saga to schedule timeout/deadline messages. See: Durable Scheduler - big picture.

view-update

Dependencies

Generic artifacts for building view update services that consume events from Event Store and update a configured view store (i.e. Sql database). See: View Update Service - big picture

view-update-sql

Dependencies

Sql (defult is Postgresql) specific implementation of view-update artifacts.

akka-ddd-test

Dependencies

Allows easy creation of test of Aggregate Root implementations. Supports both "simple" and "global" offices. See DummyOfficeSpec and DummyOfficeWithGenSpec.

akka-ddd-write-front

Dependencies

Artifacts for building http server with use of Akka Http and Akka Cluster Client responsible for handling commands sent as json messages. Provides infrastructure for demarshalling commands and forwarding them to write-backend application.