/spring-cloud-example

:memo: Microservice Architecture with Spring Cloud

Primary LanguageKotlinMIT LicenseMIT

Spring Cloud Example

microservices
├── product-composite-service
├── product-service
├── recommendation-service
└── review-service

Getting Started

  1. Build this whole project
$ cd spring-cloud-example
$ ./gradlew build -x test
  1. Run Docker Compose
$ docker-compose build
$ docker-compose up -d
  1. Open Web Browser & Connect swagger ui
http://localhost:8080/swagger-ui
  1. Run create product API (Below sample payload)
{
    "name": "title",
    "productId": 1,
    "recommendations": [
        {
            "author": "minz",
            "content": "It is recommendation!",
            "rate": 1,
            "recommendationId": 1
        }
    ],
    "reviews": [
        {
            "author": "minz",
            "content": "It sounds good",
            "reviewId": 1,
            "subject": "I highly recommend this product."
        }
    ],
    "weight": 0
}
  1. Check product (productId: 1) & wait response
  2. Check dynamic service addresses!

Services

  • product-composite-service
  • product-service
  • recommendation-service
  • review-service