File tree Expand file tree Collapse file tree
src/main/java/com/example/busnotice/domain/subway Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010import org .springframework .http .ResponseEntity ;
1111import org .springframework .stereotype .Service ;
1212import org .springframework .web .client .RestTemplate ;
13+ import org .springframework .web .client .HttpClientErrorException ;
14+ import org .springframework .web .client .HttpServerErrorException ;
15+ import org .springframework .web .client .ResourceAccessException ;
16+
17+ import java .net .SocketTimeoutException ;
1318
1419import java .net .URLEncoder ;
1520import java .nio .charset .StandardCharsets ;
@@ -75,6 +80,14 @@ public List<MergedStationDto> fetchMergedStationList(String stName) {
7580 }
7681
7782 // 특정 호선을 지나는 지하철역 리스트 반환
83+ @ Retryable (
84+ retryFor = {
85+ SocketTimeoutException .class , ResourceAccessException .class , HttpServerErrorException .class
86+ },
87+ exclude = { HttpClientErrorException .class },
88+ maxAttempts = 3 ,
89+ backoff = @ Backoff (delay = 1000 )
90+ )
7891 @ Cacheable (value = "subwayStationsOfLine" , key = "#p0" )
7992 public List <SubwayStationOfLineDto > getStationsOfLine (LineType lineType ) {
8093 String url = String .format (
You can’t perform that action at this time.
0 commit comments