Code Monkey home page Code Monkey logo

axon-shoppingmall-compensation's Introduction

Axon Framework 예제

0. 개요

이 예제는 쇼핑몰 예제로 CQRS와 SAGA Pattern을 이용해 보상 트랜잭션을 발행하는 예제입니다.

기능은 아래 4가지 기능이 있습니다.

  1. product을 등록하고
  2. 해당 product을 주문 하고
  3. 주문을 하면 product에서 개수를 차감 하고
  4. 개수가 부족하면 주문 상태를 CANCELED로 바꾸는 기능

1. Axon Server실행

이 프로젝트를 실행 하려면 Axon Server를 먼저 실행 해야 합니다.

아래와 같이 Docker를 이용해 실행 할 수 있습니다.

$ docker run -d --name my-axon-server -p 8024:8024 -p 8124:8124 axoniq/axonserver

Docker없이 .jar을 다운받아서 바로 실행 할 수 있습니다.

https://download.axoniq.io/axonserver/AxonServer.zip

$ java -jar axonserver.jar

2. API

  1. GET /product - 등록한 제품(product)을 조회합니다.

  2. GET /order - 등록한 주문을 조회 합니다.

  3. POST /product - 제품(product) 등록합니다.

RequestBody

{
    "productId":"bedcceac-8587-430c-921c-637d0b151ca2", "quantity":30
}
  1. POST /order - 주문을 등록 합니다.

RequestBody

{
    "name":"버티컬 마우스",
    "quantity":30,
    "price":10000
}

실행 방법

  1. Axon Server실행
  2. Application실행

axon-shoppingmall-compensation's People

Contributors

carlhwan avatar eternityhwan avatar kyeongrok avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  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.