Skip to Content
자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴
book

자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴

by 조너선 슈나이더, 정병열
March 2022
Beginner to intermediate
348 pages
7h 5m
Korean
Hanbit Media, Inc.
Content preview from 자바 마이크로서비스를 활용한 SRE : 기업에서 신뢰할 수 있는 마이크로서비스를 위한 패턴
327
7
장
트래픽 관리
7.7.1
재시도
다운스트림 서비스는 순간적인 장애를 자주 겪는다. 스레드 풀 포화, 네트워크 접속 지연으로
인한 시간 초과 등 가용성을 저해하는 임시적 요인들이 많다. 이러한 요인들은 통상적으로 단
시간 내에 스스로 소멸한다. 호출자는 다운스트림 호출을 래핑해 재시도를 구현하고 일시적 오
류에 대처해야 한다. 재시도를 구현할 때는 다음 세 가지 요소를 고려하자.
●
재시도의 당위성. 서비스에 대한 도메인별 지식이 있어야 판단할 수 있다. 결제용 다운스트림 서비스가
시간 초과되었을 때 재시도를 허용해야 하는가? 최초의 요청 때문에 이중 결제가 발생하지는 않는가?
●
최대 재시도 횟수 및 시간 간격. [예제
7
-
7
]은 여기에 지수 백오프
exponential
backoff
까지 추가한다.
●
항상 고정된 응답이나 예외를 반환해야 할 재시도 유형. 입력 형식이 틀려 다운스트림이
400
을 반환했
다면 동일한 입력으로 재시도했을 때도 똑같은 결과가 돌아와야 한다.
예제
7-7
Resilience4J
로 구현한 지수 백오프 재시도
RetryConfig config = RetryConfig.custom()
.intervalFunction(IntervalFunction.ofExponentialBackoff(
Duration.ofSeconds(10
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

처음 시작하는 파이썬: 파이썬 패키지를 활용한 모던 컴퓨팅 입문

처음 시작하는 파이썬: 파이썬 패키지를 활용한 모던 컴퓨팅 입문

최길우, 빌 루바노빅

Publisher Resources

ISBN: 9791162245286