내용으로 건너뛰기
권남
사용자 도구
로그인
사이트 도구
검색
도구
문서 보기
이전 판
역링크
최근 바뀜
미디어 관리자
사이트맵
로그인
>
최근 바뀜
미디어 관리자
사이트맵
추적:
springframework:http_interface
이 문서는 읽기 전용입니다. 원본을 볼 수는 있지만 바꿀 수는 없습니다. 문제가 있다고 생각하면 관리자에게 문의하세요.
====== Spring HTTP Client Interface ====== * [[https://docs.spring.io/spring-framework/reference/web/webflux-http-interface-client.html|HTTP Interface Client]] ===== retry ===== * https://stackoverflow.com/a/74631031 * [[https://docs.spring.io/spring-framework/docs/current/javadoc-api/org/springframework/web/reactive/function/client/ExchangeFilterFunction.html|ExchangeFilterFunction]] 으로 지정한다. <code java> @Bean TodoClient todoClient() { WebClient webClient = WebClient.builder() .baseUrl("sampleUrl") .filter(retryFilter()) .build(); HttpServiceProxyFactory factory = HttpServiceProxyFactory.builder(WebClientAdapter.forClient(webClient)).build(); return factory.createClient(TodoClient.class); } private ExchangeFilterFunction retryFilter() { return (request, next) -> next.exchange(request) .retryWhen( Retry.fixedDelay(3, Duration.ofSeconds(30)) .doAfterRetry(retrySignal -> log.warn("Retrying")); }; } </code> ===== 참조 ===== * [[https://www.baeldung.com/spring-6-http-interface|HTTP Interface in Spring 6 | Baeldung]]
springframework/http_interface.txt
· 마지막으로 수정됨: 2023/09/13 12:58 저자
kwon37xi
문서 도구
문서 보기
이전 판
역링크
맨 위로