This commit is contained in:
2022-03-04 15:48:13 +09:00
parent 3e80f1b332
commit f381bfe5b1
14 changed files with 872 additions and 5 deletions

View File

@@ -0,0 +1,4 @@
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-server'
}

View File

@@ -0,0 +1,15 @@
package bit.space;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.cloud.netflix.eureka.server.EnableEurekaServer;
@SpringBootApplication
@EnableEurekaServer
public class EurekaApplication {
public static void main(String[] args) {
SpringApplication.run(EurekaApplication.class, args);
}
}

View File

@@ -0,0 +1,11 @@
server:
port: 8761
spring:
application:
name: eureka-server
eureka:
client:
register-with-eureka: false
fetch-registry: false

View File

@@ -0,0 +1,5 @@
dependencies {
implementation 'org.springframework.cloud:spring-cloud-starter-gateway'
implementation 'org.springframework.cloud:spring-cloud-starter-netflix-eureka-client'
}

View File

@@ -0,0 +1,13 @@
package bit.space;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
@SpringBootApplication
public class GatewayApplication {
public static void main(String[] args) {
SpringApplication.run(GatewayApplication.class, args);
}
}

View File

@@ -0,0 +1,26 @@
server:
port: 10000
eureka:
client:
register-with-eureka: true
fetch-registry: true
service-url:
defalutZone: http://localhost:8761/eureka
spring:
application:
name: gateway-server
cloud:
gateway:
routes:
- id: member-service
uri: lb://MEMBER-SERVICE
predicates:
- Path=/member-service/**
management:
endpoints:
web:
exposure:
include: health, info, metrics, prometheus, gateway