Skip to content

Spring Boot & Axon example for creating, updating & receiving Policies

Notifications You must be signed in to change notification settings

yuukiii/axon-spring-boot-cqrs-example

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spring Boot Axon Example - Policy

This example uses Axon together with Spring Boot to create an API for creating, updating and cancelling policies.

It uses the CQRS architecture pattern as well as event sourcing to store the whole history of changes that have taken place over the lifetime of the application.

Using the API

Here are some example on how to consuming the API through HTTPie:

Create a policy

$ http POST localhost:8080/policies

HTTP/1.1 200 
Content-Type: text/plain;charset=UTF-8

85835917-7476-42fd-b759-485eeed48751

Cancel a policy

$ http POST localhost:8080/policies/85835917-7476-42fd-b759-485eeed48751/cancellation cancelDate=2018-05-01

Retrieving a policy in its latest state

$ http localhost:8080/policies/85835917-7476-42fd-b759-485eeed48751  
                                 
HTTP/1.1 200 
Content-Type: application/json;charset=UTF-8

{
    "apartmentSize": 0,
    "coverEndDate": "2018-05-01",
    "coverStartDate": "2018-01-01",
    "id": "85835917-7476-42fd-b759-485eeed48751",
    "state": "CANCELED"
}

About

Spring Boot & Axon example for creating, updating & receiving Policies

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Groovy 92.0%
  • Java 8.0%