Jelajahi Sumber

cors를 icd에서 zuul로 이동, hystrix timeout 3초로 변경

hyojungkim 5 tahun lalu
induk
melakukan
83a32a24f5

+ 2 - 0
zuulgatewayserver/bin/main/application.yml

@@ -23,6 +23,8 @@ hystrix:
       execution:
         isolation:
           strategy: THREAD  #thread로 격리
+          thread:
+            timeoutInMilliseconds: 300  #서비스가 해당시간 내에 응답하지 않으면 바로 써킷이 닫혀있더라도 fallback
       circuitBreaker:
         enabled: true
         requestVolumeThreashold: 20  #감시 시간 내 요청 수

TEMPAT SAMPAH
zuulgatewayserver/bin/main/com/idatabank/zuulgatewayapp/zuulgatewayapp/WebConfig.class


+ 14 - 0
zuulgatewayserver/src/main/java/com/idatabank/zuulgatewayapp/zuulgatewayapp/WebConfig.java

@@ -0,0 +1,14 @@
+package com.idatabank.zuulgatewayapp.zuulgatewayapp;
+
+import org.springframework.context.annotation.Configuration;
+import org.springframework.web.servlet.config.annotation.CorsRegistry;
+import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
+
+@Configuration
+public class WebConfig implements WebMvcConfigurer {
+
+  @Override
+  public void addCorsMappings(CorsRegistry registry) {
+    registry.addMapping("/**").allowedOrigins("*");
+  }
+}

+ 2 - 0
zuulgatewayserver/src/main/resources/application.yml

@@ -23,6 +23,8 @@ hystrix:
       execution:
         isolation:
           strategy: THREAD  #thread로 격리
+          thread:
+            timeoutInMilliseconds: 300  #서비스가 해당시간 내에 응답하지 않으면 바로 써킷이 닫혀있더라도 fallback
       circuitBreaker:
         enabled: true
         requestVolumeThreashold: 20  #감시 시간 내 요청 수