我们的Oauth提供程序偶尔出现打ic,这导致我们看到以下异常。 WebClientResponseException$InternalServerError: 500 Cannot get token, expected 2xx HTTP Status code
是否可以将我们的authorizationManger配置为自动重试5xx错误?
// webclient configuration
@Bean
fun webClient(): WebClient {
val oauth = ServerOAuth2AuthorizedClientExchangeFilterFunction(authorizedClientManager)
oauth.setDefaultClientRegistrationId("charges")
return WebClient.builder()
.filter(oauth)
.build()
}
// AuthorizedClientManager configuration
@Bean
fun createAuthorizedClientManager() =
AuthorizedClientServiceReactiveOAuth2AuthorizedClientManager(
reactiveClientRegistrationRepository,
reactiveOAuth2AuthorizedClientService
)