@@ -32,7 +32,6 @@ dependencies {
|
|||||||
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
implementation 'org.springframework.cloud:spring-cloud-config-server'
|
||||||
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
implementation 'org.springframework.boot:spring-boot-starter-actuator'
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
|
||||||
implementation 'org.springframework.cloud:spring-cloud-starter-bootstrap'
|
|
||||||
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
|
implementation 'com.github.ben-manes.caffeine:caffeine:3.1.8'
|
||||||
compileOnly 'org.projectlombok:lombok'
|
compileOnly 'org.projectlombok:lombok'
|
||||||
annotationProcessor 'org.projectlombok:lombok'
|
annotationProcessor 'org.projectlombok:lombok'
|
||||||
|
@@ -2,8 +2,10 @@ package dev.mars3142.fhq.config;
|
|||||||
|
|
||||||
import org.springframework.boot.SpringApplication;
|
import org.springframework.boot.SpringApplication;
|
||||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||||
|
import org.springframework.cloud.config.server.EnableConfigServer;
|
||||||
|
|
||||||
@SpringBootApplication
|
@SpringBootApplication
|
||||||
|
@EnableConfigServer
|
||||||
public class ConfigServiceApplication {
|
public class ConfigServiceApplication {
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
|
@@ -1,9 +1,3 @@
|
|||||||
logging:
|
|
||||||
level:
|
|
||||||
com:
|
|
||||||
netflix:
|
|
||||||
discovery: off
|
|
||||||
|
|
||||||
server:
|
server:
|
||||||
port: ${PORT:8888}
|
port: ${PORT:8888}
|
||||||
|
|
||||||
@@ -15,3 +9,5 @@ spring:
|
|||||||
server:
|
server:
|
||||||
native:
|
native:
|
||||||
search-locations: classpath:/configurations
|
search-locations: classpath:/configurations
|
||||||
|
profiles:
|
||||||
|
active: native
|
@@ -16,7 +16,7 @@ logging:
|
|||||||
level:
|
level:
|
||||||
com:
|
com:
|
||||||
netflix:
|
netflix:
|
||||||
discovery: ERROR
|
discovery: off
|
||||||
|
|
||||||
management:
|
management:
|
||||||
endpoint:
|
endpoint:
|
||||||
|
50
src/main/resources/configurations/edge-service.yml
Normal file
50
src/main/resources/configurations/edge-service.yml
Normal file
@@ -0,0 +1,50 @@
|
|||||||
|
server:
|
||||||
|
port: ${PORT:8080}
|
||||||
|
|
||||||
|
spring:
|
||||||
|
cloud:
|
||||||
|
gateway:
|
||||||
|
default-filters:
|
||||||
|
- name: Retry
|
||||||
|
args:
|
||||||
|
retries: 3
|
||||||
|
methods: GET
|
||||||
|
series: SERVER_ERROR
|
||||||
|
exceptions: java.io.IOException, java.util.concurrent.TimeoutException
|
||||||
|
backoff:
|
||||||
|
firstBackoff: 50ms
|
||||||
|
maxBackoff: 5000ms
|
||||||
|
discovery:
|
||||||
|
locator:
|
||||||
|
enabled: false
|
||||||
|
routes:
|
||||||
|
- id: edge
|
||||||
|
uri: lb://edge-service
|
||||||
|
predicates:
|
||||||
|
- Path=/v3/api-docs/**
|
||||||
|
filters:
|
||||||
|
- RewritePath=/v3/api-docs/(?<path>.*), /$\{path}/v3/api-docs
|
||||||
|
|
||||||
|
- id: timezone-service
|
||||||
|
uri: lb://timezone-service
|
||||||
|
predicates:
|
||||||
|
- Path=/v1/timezone/**, /health/timezone, /timezone/v3/api-docs
|
||||||
|
filters:
|
||||||
|
- RewritePath=/health/timezone, /actuator/health
|
||||||
|
- RewritePath=/timezone/(?<segment>.*), /$\{segment}
|
||||||
|
|
||||||
|
- id: google-service
|
||||||
|
uri: ${GOOGLE_SERVICE_URI:http://google-service.web:8080}
|
||||||
|
predicates:
|
||||||
|
- Path=/v1/account/**, /health/google, /google/v3/api-docs
|
||||||
|
filters:
|
||||||
|
- RewritePath=/health/google, /actuator/health
|
||||||
|
- RewritePath=/google/(?<segment>.*), /$\{segment}
|
||||||
|
|
||||||
|
- id: token-service
|
||||||
|
uri: ${BACKEND_SERVICE_URI:http://backend-service.web:8080}
|
||||||
|
predicates:
|
||||||
|
- Path=/v1/token/**, /health/backend, /token/v3/api-docs
|
||||||
|
filters:
|
||||||
|
- RewritePath=/health/backend, /actuator/health
|
||||||
|
- RewritePath=/token/(?<segment>.*), /$\{segment}
|
Reference in New Issue
Block a user