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.
Make sure you have an Apache Kafka broker running on localhost:9092 and a topic called "axon-test"
mvn clean install
mvn clean install && mvn exec:java -Dexec.mainClass="org.hifly.axon.bank.account.BankAccountApp"
mvn clean install && mvn exec:java -Dexec.mainClass="org.hifly.axon.bank.account.CloseAccountApp"