zuul retry

This commit is contained in:
assu10
2020-12-28 15:29:04 +09:00
parent 873cb2f8bf
commit df051147c3
5 changed files with 10 additions and 7 deletions

View File

@@ -76,7 +76,8 @@ POST http://localhost:8889/decrypt
---
***- Eureka (Service Registry & Discovery)***<br />
자세한 설명은 [Spring Cloud - Spring Cloud Eureka](https://assu10.github.io/dev/2020/08/26/spring-cloud-eureka/) 를 참고
자세한 설명은 [Spring Cloud - Spring Cloud Eureka](https://assu10.github.io/dev/2020/08/26/spring-cloud-eureka/)
[Spring Cloud - Spring Cloud Eureka (상세 설정편)](https://assu10.github.io/dev/2020/12/05/spring-cloud-eureka-configuration/)를 참고
```shell script
HOW TO RUN
@@ -136,7 +137,8 @@ GET http://localhost:8070/event/member/hyori
***- Zuul (Proxy & API Gateway)***<br />
자세한 설명은 [Spring Cloud - Netflix Zuul(1/2)](https://assu10.github.io/dev/2020/08/26/netflix-zuul/)와
[Spring Cloud - Netflix Zuul(2/2)](https://assu10.github.io/dev/2020/09/05/netflix-zuul2/) 를 참고
[Spring Cloud - Netflix Zuul(2/2)](https://assu10.github.io/dev/2020/09/05/netflix-zuul2/),
[Spring Cloud - Netflix Zuul(Ribbon) Retry](https://assu10.github.io/dev/2020/12/06/netflix-zuul-retryable/)를 참고
```shell script
HOW TO RUN

View File

@@ -25,7 +25,7 @@ eureka:
enable-self-preservation: true # 일시적인 네트워크 장애로 인한 서비스 해제 막기 위한 자기 보호 모드 (디폴트 true, 운영에선 반드시 true 로 설정 필요)
response-cache-update-interval-ms: 30000 # 유레카 서버의 캐싱 업데이트 주기 (디폴트 30,000ms)
eviction-interval-timer-in-ms: 60000 # 클라이언트로부터 하트비트가 계속 수신 되는지 점검 (디폴트 60,000)
wait-time-in-ms-when-sync-empty: 3000 # 유레카 서버가 시작되고 유레카 피어링 노드로부터 Instance 들을 가져올 수 없을 때 기다릴 시간 (디폴트 3000ms, 운영 환경에선 삭제 필요)
wait-time-in-ms-when-sync-empty: 3000 # 유레카 서버가 시작되고 유레카 피어링 노드로부터 Instance 들을 가져올 수 없을 때 기다릴 시간 (디폴트 3000ms)
registry-sync-retries: 5 # 유레카 피어 노드로부터 registry 를 갱신할 수 없을 때 재시도 횟수 (디폴트 5)
client:
register-with-eureka: false

View File

@@ -53,7 +53,7 @@ public class EventController {
*/
@GetMapping(value = "gift/{name}")
public String gift(@PathVariable("name") String gift) {
sleep();
//sleep();
return "[EVENT] Gift is " + gift;
}

View File

@@ -20,6 +20,7 @@ public class EventRestTemplateClient {
String ZUUL_URL_PREFIX = "/api/evt/event/"; // 이벤트 서비스의 주울 라우팅경로와 이벤트 클래스 주소
public String gift(String name) {
System.out.println("----------http://" + customConfig.getServiceIdZuul() + ZUUL_URL_PREFIX + "gift/{name}");
/*ResponseEntity<EventGift> restExchange =
restTemplate.exchange(
"http://event-service/event/gift/{name}",

View File

@@ -52,7 +52,7 @@ event-service: # 이 부분이 없으면 전체적으로 설정 적용
MaxAutoRetriesNextServer: 1 # 첫 시도 실패시 다음 서버로 재시도 하는 수 (첫번째 전송은 제외)
# ReadTimeout: 1000 # HttpClient 의 Read Timeout (데이터를 읽어오는 과정의 Timeout 시간)
# ConnectTimeout: 2000 # HttpClient 의 Connection timeout (연결과정의 Timeout 시간)
ReadTimeout: 1000 # HttpClient 의 Read Timeout (디폴트 1,000 ms, 데이터를 읽어오는 과정의 Timeout 시간)
ReadTimeout: 3000 # HttpClient 의 Read Timeout (디폴트 1,000 ms, 데이터를 읽어오는 과정의 Timeout 시간)
ConnectTimeout: 1000 # HttpClient 의 Connection timeout (디폴트 1,000 ms, 연결과정의 Timeout 시간)
hystrix:
@@ -60,7 +60,7 @@ hystrix:
default:
circuitBreaker:
sleepWindowInMilliseconds: 5000 # 서킷 브레이커가 열린 후 서비스의 회복 상태를 확인할 때까지 대기할 시간 간격. 즉, 서킷 브레이커가 열렸을 때 얼마나 지속될지...(디폴트 5000)
errorThresholdPercentage: 50 # 서킷 브레이커가 열린 후 requestVolumeThreshold 값만큼 호출한 후 타임아웃, 예외, HTTP 500 반환등으로 실패해야 하는 호출 비율 (디폴트 50)
errorThresholdPercentage: 50 # 서킷 브레이커가 열리기 위헤 requestVolumeThreshold 값만큼 호출한 후 타임아웃, 예외, HTTP 500 반환등으로 실패해야 하는 호출 비율 (디폴트 50)
requestVolumeThreshold: 10 # 히스트릭스가 호출 차단을 고려하는데 필요한 시간인 10초(metrics.rollingStats.timeInMilliseconds) 동안 연속 호출 횟수 (디폴트 20)
metrics:
rollingStats:
@@ -71,7 +71,7 @@ hystrix:
execution:
isolation:
thread:
timeoutInMilliseconds: 4100 # 히스트릭스 타임아웃 5초로 설정 (기본 1초, ribbon 의 타임아웃보다 커야 기대하는 대로 동작함)
timeoutInMilliseconds: 8100 # 히스트릭스 타임아웃 5초로 설정 (기본 1초, ribbon 의 타임아웃보다 커야 기대하는 대로 동작함)
logging:
level: