- 2 instances of Player applications need to be run
- Player 1 will latch on port 8080 while player 2 will start on port 8090
- all changes to the score are stored as events in the event store
- Axon
- Spring
start one instance with auto argument as shown below followed by another instance of application
java -jar player-0.0.1-SNAPSHOT.jar auto
java -jar player-0.0.1-SNAPSHOT.jar
21-01-2019 15:40:20.687 [pool-1-thread-2] [player1] INFO com.game.player.controller.GameController.onSuccess - GAME OVER !!
start both the instances and then fire
POST http://localhost:8080/game/start
{
"initialValue":100
}
java -jar player-0.0.1-SNAPSHOT.jar
java -jar player-0.0.1-SNAPSHOT.jar
21-01-2019 15:40:20.687 [pool-1-thread-2] [player1] INFO com.game.player.controller.GameController.onSuccess - GAME OVER !!
curl -X PUT --data 100 -H "Content-Type: application/json" localhost:8090/game/{scoreId}/move
curl -X GET localhost:8090/game/{scoreId}/events/
- minor gap between the application start and port capture can lead to one instance not starting.
- events API shows all changes made against the aggregate inside its instance. Consolidated events from both the instances when sorted by Time can give exact details of all delta against the aggregate.
- Code coverage is not 100%