====== 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]] 으로 지정한다. @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")); }; } ===== 참조 ===== * [[https://www.baeldung.com/spring-6-http-interface|HTTP Interface in Spring 6 | Baeldung]]