By: Ben Wilcock (Pivotal) & Steven van Beelen (AxonIQ)
Axon Trader is a new open-source reference architecture that demonstrates how to deliver "evolutionary" microservice applications to production in minutes.
This repository provides a demo Wallet application following a similar route as the Axon Trader application, used during a live coding presentation at GoTo Amsterdam 2019.
As such, this sample app utilizes both Spring Boot and Axon Framework to provide a small use case of how CQRS, Event Sourcing and DDD can be incorporated.
Each step has it's own branch, allowing you to:
- Check out the branch you are interested in.
- Perform a
git reset --hard step#
to reset your current branch.
This serves as a back-up during the presentation and as a convenience method for any one interested in this sample, as it makes traversing the taken steps easier.
The following steps have been defined for this project:
- The introduction of commands and events to the core-api.
- The basic Command Model as an Aggregate, the Wallet, contained in it's own package.
- A means to dispatch commands through a controller in the UI folder.
- A simple Query Model, the WalletView, which an Event Handling class updates based on events.
- Introduction of queries and query handlers, respectively dispatched by the UI and handled by the projector.
Pushing an application (with a manifest.yml)
cf push
Check the application...
curl -X GET wallet.cfapps.io/hello
Initialise the application...
curl -X GET wallet.cfapps.io/command
Creating a MySQL Database (on PWS)
cf create-service cleardb spark mysql
Binding a database
cf bind-service wallet mysql
Initialise the application...
curl -X GET wallet.cfapps.io/command
Query for Wallets...
curl -X GET wallet.cfapps.io/query/wallets
applications:
- name: wallet
path: target/wallet-0.0.1-SNAPSHOT.jar
instances: 1
routes:
- route: wallet.cfapps.io