Created
October 7, 2014 13:06
-
-
Save akirillov/55025b30bd910f4077b3 to your computer and use it in GitHub Desktop.
Finagle default HttpClient configured with timeouts and retry filters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
val retry = new RetryingFilter[HttpRequest, HttpResponse]( | |
retryPolicy = RetryPolicy.tries(3), | |
timer = DefaultTimer.twitter | |
) | |
val timeout = new TimeoutFilter[HttpRequest, HttpResponse]( | |
timeout = 3.seconds, | |
timer = DefaultTimer.twitter | |
) | |
private lazy val client = retry andThen timeout andThen Http.newService(servers.mkString(",")) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment