Ver código fonte

zuul gateway 설정 완료

hyojungkim 5 anos atrás
pai
commit
9d8d89e47e

+ 4 - 2
eurekaserver/bin/main/application.properties

@@ -1,3 +1,5 @@
+spring.application.name=eureka-server
+eureka.client.serviceUrl.defaultZone=http://${EUREKA}/eureka/
 server.port=8761
-eureka.client.register-with-eureka=false
-eureka.client.fetch-registry=false
+eureka.client.register-with-eureka=true
+eureka.client.fetch-registry=true

+ 4 - 2
eurekaserver/src/main/resources/application.properties

@@ -1,3 +1,5 @@
+spring.application.name=eureka-server
+eureka.client.serviceUrl.defaultZone=http://${EUREKA}/eureka/
 server.port=8761
-eureka.client.register-with-eureka=false
-eureka.client.fetch-registry=false
+eureka.client.register-with-eureka=true
+eureka.client.fetch-registry=true

+ 5 - 8
zuulgatewayapp/bin/main/application.yml

@@ -2,17 +2,11 @@ spring:
   application:
     name: api-gateway
 
-eureka:
-  client:
-    fetch-registry: true
-    service-url:
-      defaultZone: http://${EUREKA}/eureka
-
 zuul:
   ignored-services: "*"
   prefix: /api
   routes:
-    icd-kcd-service:
+    icd-search:
       path: /icd/**
       url: "http://${URL}"
       strip-prefix: false
@@ -27,10 +21,13 @@ hystrix:
             timeoutInMilliseconds: 61000
 
 ribbon:
+  MaxAutoRetries: 3
+  eureka:
+    enabled: false
   ConnectTimeout: 60000
   ReadTimeout: 60000
 
-# icd-kcd-service:
+# icd-search:
 #   ribbon: 
 #     eureka:
 #       enabled: true

BIN
zuulgatewayapp/bin/main/com/idatabank/zuulgatewayapp/zuulgatewayapp/ZuulGatewayApplication.class


+ 0 - 2
zuulgatewayapp/src/main/java/com/idatabank/zuulgatewayapp/zuulgatewayapp/ZuulGatewayApplication.java

@@ -2,13 +2,11 @@ package com.idatabank.zuulgatewayapp.zuulgatewayapp;
 
 import org.springframework.boot.SpringApplication;
 import org.springframework.boot.autoconfigure.SpringBootApplication;
-import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
 import org.springframework.cloud.netflix.hystrix.dashboard.EnableHystrixDashboard;
 import org.springframework.cloud.netflix.zuul.EnableZuulProxy;
 
 @SpringBootApplication
 @EnableZuulProxy
-@EnableEurekaClient
 @EnableHystrixDashboard
 public class ZuulGatewayApplication {
 

+ 5 - 8
zuulgatewayapp/src/main/resources/application.yml

@@ -2,17 +2,11 @@ spring:
   application:
     name: api-gateway
 
-eureka:
-  client:
-    fetch-registry: true
-    service-url:
-      defaultZone: http://${EUREKA}/eureka
-
 zuul:
   ignored-services: "*"
   prefix: /api
   routes:
-    icd-kcd-service:
+    icd-search:
       path: /icd/**
       url: "http://${URL}"
       strip-prefix: false
@@ -27,10 +21,13 @@ hystrix:
             timeoutInMilliseconds: 61000
 
 ribbon:
+  MaxAutoRetries: 3
+  eureka:
+    enabled: false
   ConnectTimeout: 60000
   ReadTimeout: 60000
 
-# icd-kcd-service:
+# icd-search:
 #   ribbon: 
 #     eureka:
 #       enabled: true

+ 5 - 6
zuulgatewayserver/bin/main/application.yml

@@ -10,9 +10,10 @@ eureka:
 
 zuul:
   ignored-services: "*"
+  prefix: /api
   routes:
-    api-gateway:
-      path: /api/**
+    icd-search:
+      path: /icd/**
       strip-prefix: false
 
 hystrix:
@@ -28,10 +29,8 @@ ribbon:
   ConnectTimeout: 60000
   ReadTimeout: 60000
 
-api-gateway:
-  ribbon: 
-    eureka:
-      enabled: true
+icd-search:
+  ribbon:
     NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList
     ConnectTimeout: 50000
     ReadTimeout: 50000

+ 5 - 6
zuulgatewayserver/src/main/resources/application.yml

@@ -10,9 +10,10 @@ eureka:
 
 zuul:
   ignored-services: "*"
+  prefix: /api
   routes:
-    api-gateway:
-      path: /api/**
+    icd-search:
+      path: /icd/**
       strip-prefix: false
 
 hystrix:
@@ -28,10 +29,8 @@ ribbon:
   ConnectTimeout: 60000
   ReadTimeout: 60000
 
-api-gateway:
-  ribbon: 
-    eureka:
-      enabled: true
+icd-search:
+  ribbon:
     NIWSServerListClassName: com.netflix.niws.loadbalancer.DiscoveryEnabledNIWSServerList
     ConnectTimeout: 50000
     ReadTimeout: 50000