Coder Social home page Coder Social logo

kevintich / bank-account-axon Goto Github PK

View Code? Open in Web Editor NEW

This project forked from hifly81/bank-account-axon

0.0 0.0 0.0 54 KB

Example of an application that manages a bank account with Axon framework - CQRS - Event Sourcing - Saga

Java 100.00%

bank-account-axon's Introduction

Bank Account - Axon

Example of an application that manages a bank account.
This an example of an event-driven application, implementing patterns as event sourcing, cqrs, saga.

Events sent to the event bus and to the event bus are persisted to an Apache Kafka topic called "axon-test"..

Simple bank accounts commands/events are sent using Axon Framework; the events provided are:

  • create account
  • close account
  • deposit
  • withdrawal

Events are aggregated using the AccountAggregate class.

When a bank account is going to be closed, this is managed using a saga; an implementation of a saga pattern is realized using the CloseAccountSaga class.

The close account event is sent by a simulated external service.

Prerequisites

Make sure you have an Apache Kafka broker running on localhost:9092 and a topic called "axon-test"

Compile and execute test

  mvn clean install

Run a sample deposit/withdrawal simulation

  mvn clean install && mvn exec:java -Dexec.mainClass="org.hifly.axon.bank.account.BankAccountApp"

Run a close account simulation

  mvn clean install && mvn exec:java -Dexec.mainClass="org.hifly.axon.bank.account.CloseAccountApp"

bank-account-axon's People

Contributors

hifly81 avatar

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.