项目作者: babaei503

项目描述 :
Microservices saga pattern
高级语言: Java
项目地址: git://github.com/babaei503/microservices-saga-pattern.git
创建时间: 2020-09-06T08:19:19Z
项目社区:https://github.com/babaei503/microservices-saga-pattern

开源协议:

下载


Microservice Saga Pattern

Microservice Saga Patten using RabbitMQ. There are two types of architecture for this
pattern: Choreography and Orchestration. For this example, I used the Choreography one.

I did not create the product microservice. Products will be saveed in the stock-service.

The management plugin is included in the RabbitMQ distribution. It must be enabled
before it can be used:

rabbitmq-plugins enable rabbitmq_management

http://localhost:15672/

To import definitions using rabbitmqctl, use:

rabbitmqctl import_definitions /path/rabbitmq-definitions.json

Order Service

This service responsible for handling information regarding orders.

Run this project as a Spring Boot app (e.g. import into IDE and run
main method, or use “mvn spring-boot:run”).

Create order - Post method:

http://localhost:8080/api/orders

  1. {
  2. "productId": 3,
  3. "quantity": 4,
  4. "value": 70
  5. }

Get all orders - Get method:

http://localhost:8080/api/orders

Payment Service

This service responsible for handling information regarding payments.

Run this project as a Spring Boot app (e.g. import into IDE and run
main method, or use “mvn spring-boot:run”).

Stock Service

This service responsible for handling information regarding stocks.

Run this project as a Spring Boot app (e.g. import into IDE and run
main method, or use “mvn spring-boot:run”).