-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
아래와 같이 서비스들에 라우팅 해줄 경우에는
실제 서비스로 라우팅될때 http://서비스/member-service/api/... 형식으로 들어간다
서비스에서 일일이 컨트롤러나 기타 설정 url들의 prefix로 /member-service를 넣어서 해결해줄수도 있지만
이작업은 매우 번거롭고 여러명이서 개바할경우 실수의 여지가 분명히 있을 것이고
이것은 이어서 커뮤니케이션 비용이 발생할것이다
이런 문제를 Gateway단에서 해결할 수 있다
server:
port: 8888
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defaultZone: http://localhost:8761/eureka
spring:
application:
name: apigateway-service
cloud:
gateway:
routes:
- id: member-service
uri: lb://MEMBER-SERVICE
predicates:
- Path=/member-service/**
- id: order-service
uri: lb://ORDER-SERVICE
predicates:
- Path=/order-service/**
- id: product-service
uri: lb://PRODUCT-SERVICE
predicates:
- Path=/product-service/**Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels