쵼쥬
쵼쥬의 개발공부 TIL
쵼쥬
전체 방문자
오늘
어제
  • 분류 전체보기 (276)
    • 코딩테스트 (192)
      • [알고리즘] 알고리즘 정리 (7)
      • [백준] 코딩테스트 연습 (126)
      • [프로그래머스] 코딩테스트 연습 (59)
    • Spring (71)
      • [인프런] 스프링 핵심 원리- 기본편 (9)
      • [인프런] 스프링 MVC 1 (6)
      • [인프런] 스프링 MVC 2 (4)
      • [인프런] 실전! 스프링 부트와 JPA 활용1 (7)
      • [인프런] 실전! 스프링 부트와 JPA 활용2 (5)
      • [인프런] 실전! 스프링 데이터 JPA (7)
      • [인프런] 실전! Querydsl (7)
      • JWT (5)
      • [인프런] Spring Cloud (17)
      • [인프런] Spring Batch (4)
    • Java (6)
      • [Java8] 모던인자바액션 (4)
      • [부스트코스] 웹 백엔드 (2)
      • [패스트캠퍼스] JAVA STREAM (0)
    • CS (6)
      • 디자인 패턴과 프로그래밍 패터다임 (2)
      • 네트워크 (4)

블로그 메뉴

  • 홈

공지사항

인기 글

태그

  • 누적합
  • 백분
  • 스프링
  • Spring Data JPA
  • 인프런
  • BFS
  • 알고리즘
  • 타임리프
  • 코딩테스트
  • 백준
  • 위클리 챌린지
  • 프로그래머스
  • 부스트코스
  • 구현
  • 비트마스킹
  • spring
  • jpa
  • 자바
  • querydsl
  • MVC

최근 댓글

최근 글

티스토리

hELLO · Designed By 정상우.
쵼쥬

쵼쥬의 개발공부 TIL

Catalogs, Orders Microservice
Spring/[인프런] Spring Cloud

Catalogs, Orders Microservice

2022. 6. 19. 15:26
기능 마이크로서비스 URI(API Gateway 사용시) HTTP Method
상품 목록 조회 Catalogs Microservice /catalog-service/catalogs GET
사용자별 상품 주문 Orders Microservice /order-service/{user_id}/orders POST
사용자별 주문 내역 조회 Orders Microservice /order-service/{user_id}/orders GET

Catalogs Microservice 프로젝트 생성

Dependencies

DevTools, Lombok, Spring Web, Spring Data JPA, Eureka Discovery Client, H2, modelmapper

 

application.yml

server:
  port: 0 # random port 실행함

spring:
  application:
    name: datalog-service
  h2:
    console:
      enabled: true
      settings:
        web-allow-others: true
      path: /h2-console
  datasource:
    driver-class-name: org.h2.Driver
    url: jdbc:h2:mem:testdb
  jpa:
    hibernate:
      ddl-auto: create-drop
    show-sql: true
    generate-ddl: true
    database: h2
    defer-datasource-initialization: true


eureka:
  instance:
    instance-id: ${spring.application.name}:${spring.application.instance_id:${random.value}}

  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://127.0.0.1:8761/eureka

logging:
  level:
    com.example.catalogservice: DEBUG

Orders Microservice 프로젝트 생성

Dependencies

DevTools, Lombok, Spring Web, Spring Data JPA, Eureka Discovery Client, H2, modelmapper

 

application.yml

server:
  port: 0 # random port 실행함

spring:
  application:
    name: order-service
  h2:
    console:
      enabled: true
      settings:
        web-allow-others: true
      path: /h2-console
  datasource:
    driver-class-name: org.h2.Driver
    url: jdbc:h2:mem:testdb
  jpa:
    hibernate:
      ddl-auto: update
    show-sql: true
    generate-ddl: true
    database: h2


eureka:
  instance:
    instance-id: ${spring.application.name}:${spring.application.instance_id:${random.value}}

  client:
    register-with-eureka: true
    fetch-registry: true
    service-url:
      defaultZone: http://127.0.0.1:8761/eureka

logging:
  level:
    com.example.orderservice: DEBUG

 

Entity를 직렬화 (마샬링, 언마샬링하기 위해)

'Spring > [인프런] Spring Cloud' 카테고리의 다른 글

Configuration Service  (0) 2022.06.24
Users Microsservice - Login  (0) 2022.06.20
Users Microservice  (0) 2022.06.18
E-commerce 어플리케이션  (0) 2022.06.18
API Gateway Service  (0) 2022.06.17
    'Spring/[인프런] Spring Cloud' 카테고리의 다른 글
    • Configuration Service
    • Users Microsservice - Login
    • Users Microservice
    • E-commerce 어플리케이션
    쵼쥬
    쵼쥬

    티스토리툴바