Skip to content

Instantly share code, notes, and snippets.

@atesibrahim
Last active July 16, 2022 14:51
Show Gist options
  • Save atesibrahim/48f0aa48cc914a19b18636e210064852 to your computer and use it in GitHub Desktop.
Save atesibrahim/48f0aa48cc914a19b18636e210064852 to your computer and use it in GitHub Desktop.
Feign Client Configuration
public class BookClientFeignConfiguration {
private static final int CONNECT_TIMEOUT_MILLIS = 5000;
private static final int READ_TIMEOUT_MILLIS = 5000;
@Bean
public Contract useBookClientFeignAnnotations() {
return new SpringMvcContract();
}
@Bean
public BookClientErrorDecoder bookClientErrorDecoder() {
return new BookClientErrorDecoder();
}
@Bean
public Request.Options options() {
return new Request.Options(CONNECT_TIMEOUT_MILLIS, READ_TIMEOUT_MILLIS);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment