GithubHelp home page GithubHelp logo

dfelski / spring-boot-axon-cqrs-docker-example Goto Github PK

View Code? Open in Web Editor NEW
3.0 1.0 3.0 18 KB

Simple example how the Axon Framework can be used with Spring Boot to implement CQRS and Event Sourcing

License: Apache License 2.0

Dockerfile 5.97% Java 94.03%
java axon-framework spring-boot axon docker docker-compose

spring-boot-axon-cqrs-docker-example's Introduction

Spring Boot Axon CQRS Docker Example

This is a simple example how the Axon Framework can be used with Spring Boot to implement CQRS and Event Sourcing. It's about peanuts!

Run it

Just run Docker Compose to build and start the containers.

docker-compose up --build

Test it

The scenario is simple: place a bowl on a table, fill it with some peanuts and don't let them go bad.

The command service runs on http://localhost:8081, the query service in http://localhost:8082.

To put a new bowl on the table just do

POST http://localhost:8081/bowl

The result contains a UUID which identifies the bowl for further actions. Let's fill the bowl with some peanuts

PUT http://localhost:8081/bowl/<uuid>/peanuts 

{"amount" : "100"}

The bowl should contain 100 peanuts now, let's check this

GET http://localhost:8082/bowl/<uuid>/peanuts

Yummy! We should be able to take some peanuts out of the bowl now

DELETE http://localhost:8081/bowl/<uuid>/peanuts

{"amount" : "10"}

Let's see how many peanuts are left

GET http://localhost:8082/bowl/<uuid>/peanuts

Oh, only 90...

Enjoy your meal!

spring-boot-axon-cqrs-docker-example's People

Contributors

dfelski avatar

Stargazers

 avatar  avatar  avatar

Watchers

 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.