Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

airframe-http: Add HttpClient #482

Merged
merged 45 commits into from
Apr 18, 2019
Merged

airframe-http: Add HttpClient #482

merged 45 commits into from
Apr 18, 2019

Conversation

xerial
Copy link
Member

@xerial xerial commented Mar 31, 2019

Add a common interface and finagle-based implementation for an http client. #472

  • Simplify Retryer (=> RetryContext) to support http error handling airframe-control: Remove context from Control.Retrier #467 Retryer -> RetryContext #491
  • Add HttpStatus code representations using type classes (xxxAdapter)
  • Add a standard HTTP response hander Add a basic retry pattern set for HTTP requests #366
  • Add a finagle-based HTTP client
  • Add async/sync http clients. Using F[_] as an abstraction of Future. This is useful to remove the dependency to Finagle in airframe-http.
  • Support circuit breaker (No code for this. We can use circuit breaker of Finagle by customizing FinagleClientConfig.initClient)
  • Integrate control.Retry and FinagleRetryFilter.
    • Finagle will not enable request retry by default, so we anyway need to add our own retry filter.
    • Simplified control.Retry so that we can use this retry logic both for imperative programming and Future-based programming.
  • Support response/request -> object mapping with airframe-codec.

@codecov
Copy link

codecov bot commented Apr 1, 2019

Codecov Report

Merging #482 into master will decrease coverage by 0.17%.
The diff coverage is 90.64%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #482      +/-   ##
==========================================
- Coverage   83.79%   83.62%   -0.18%     
==========================================
  Files         193      200       +7     
  Lines        7586     7919     +333     
  Branches      684      699      +15     
==========================================
+ Hits         6357     6622     +265     
- Misses       1229     1297      +68
Impacted Files Coverage Δ
...rc/main/scala/wvlet/airframe/http/HttpStatus.scala 100% <100%> (ø)
...rc/main/scala/wvlet/airframe/http/HttpClient.scala 100% <100%> (ø)
.../main/scala/wvlet/airframe/http/RouteMatcher.scala 92.53% <100%> (+0.11%) ⬆️
...ttp/src/main/scala/wvlet/airframe/http/Route.scala 100% <100%> (ø) ⬆️
...ain/scala/wvlet/airframe/control/ResultClass.scala 100% <100%> (ø)
...tp/src/main/scala/wvlet/airframe/http/Router.scala 100% <100%> (ø) ⬆️
.../scala/wvlet/airframe/http/HttpResponseCodec.scala 54.54% <54.54%> (ø)
...cala/wvlet/airframe/http/HttpClientException.scala 76.27% <76.27%> (ø)
...http/src/main/scala/wvlet/airframe/http/Http.scala 80% <80%> (-20%) ⬇️
...let/airframe/http/finagle/FinagleRetryFilter.scala 89.47% <89.47%> (ø)
... and 21 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 143c629...0600a10. Read the comment docs.

@xerial xerial mentioned this pull request Apr 16, 2019
@xerial xerial changed the title [WIP] airframe-http: Add HttpClient airframe-http: Add HttpClient Apr 16, 2019
@xerial xerial requested review from Lewuathe and takezoe April 16, 2019 21:56
Copy link
Member

@takezoe takezoe left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@xerial Thanks for your great work! I have some questions on it just to be sure. Please can you take a look?

@xerial
Copy link
Member Author

xerial commented Apr 18, 2019

CI is failing because of jdk11 download failure. Other than that, we are good to merge this PR.

@xerial xerial merged commit 4bb9463 into wvlet:master Apr 18, 2019
@xerial xerial deleted the http-client branch April 18, 2019 18:47
@takezoe
Copy link
Member

takezoe commented Apr 19, 2019

@xerial Thanks for your quick fix!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants