Releases: cloudwego/volo
Volo-HTTP 0.4.0-rc.5
What's Changed
- The behavior of using the default version of the HTTP protocol is not appropriate, because all HTTP servers support HTTP/1.1, but not all HTTP servers support HTTP/2, so it is not appropriate to select HTTP/2 by default when both versions are supported. So in this PR, we use HTTP/1.1 by default when
"http1"is enabled - There's no HTTP proxy implementation in Volo-HTTP, and when running unit tests using nodes in mainland China, the test fails due to abnormal access to
httpbin.org. So we addHttpProxyLayerin Volo-HTTP, it supports HTTP proxy defined in rfc7230 and it can read address from environment variable (http_proxyandHTTP_PROXY) or be set manually. - There are some inappropriate aspects of the previous DNS Resolver implementation, we adjust it in Volo-HTTP and Volo-gRPC which is copied from Volo-HTTP with some modifies.
- For better observability, we add
SpanProviderfor Volo-HTTP, it can enter a user defined span when serving a request.
Pull Request: chore(volo-http): adjust some codes by @yukiiiteru in #590
Full Changelog: volo-http-0.4.0-rc.4...volo-http-0.4.0-rc.5
Volo-HTTP 0.4.0-rc.4
What's Changed
- Throw a
compile_errorif nither feature"http1"nor"http2"is disabled - Use only
"http1"indefault-clientanddefault-server - Set
default-clientanddefault-serveras default features - Re-export
ClientTransportservice for users to import into their inner layers. - Use
DiscoverKeyinstead of(FastStr, u16)asDiscover::Key - Rename
DefaultLBandDefaultLBServicetoDefaultLbandDefaultLbService - Remove deprecated
ClientRequest,ServerRequest,ClientResponse,ServerResponse - Reduce some generic constraints
- Fix infinite loop printing warn log when discover's watch channel is closed
Detailed commits
- fix: Infinite loop printing warn log when discover's watch channel is closed. by @intfish123 in #585
- chore(volo-http): improve user experience by @yukiiiteru in #587
Full Changelog: volo-http-0.4.0-rc.3...volo-http-0.4.0-rc.4
Volo-HTTP 0.4.0-rc.3
What's Changed
Considering that default Target of Client is used less frequently, but it makes Target selection logic of Client too complicated, we have removed default Target of Client in this version.
However, we have added TargetLayer, it can force Client to set a Target, which can provide a similar experience as before.
With the removal of default Target of Client, configuration of default Host is also removed. Here we adjust the original Host Layer to be more flexible, which can be set to None, Auto, Force, Fallback modes.
The default callee name has been removed in favor of the with_callee_name method of TargetLayer. This is only necessary when accessing an HTTPS address via an IP address and needing to set up SNI.
Additionally, RequestBuilder::full_uri has been removed. We recommend using a Layer to implement this functionality rather than in RequestBuilder, and an example will be pushed later.
Break Changes
- Remove default target related functions of
ClientBuilder:ClientBuilder::addressClientBuilder::hostClientBuilder::with_portClientBuilder::with_schemeClientBuilder::target_refClientBuilder::target_mut
- Refactor
Hostlayer, andClientBuilder::default_hostis updated toClientBuilder::host_mode - Remove
RequestBuilder::full_uri
Related Commits
- chore(volo-http): fix clippy warning
mismatched_lifetime_syntaxesby @yukiiiteru in #576 - chore(volo-http): refactor target logics of http client by @yukiiiteru in #580
Full Changelog: volo-http-0.4.0-rc.2...volo-http-0.4.0-rc.3
Volo 0.10.7
What's Changed
In this version, Volo adds support for ALPN of TLS through:
- feat(volo-http): support http/2 for server by @yukiiiteru in #573
Volo-HTTP 0.4.0-rc.2
What's Changed
Volo-HTTP supports HTTP/2 for both server and client, and connection pool for client is also supported.
Detailed commits
- feat(volo-http): support http/2 for server by @yukiiiteru in #573
- feat(volo-http): support http2 and connection pool for client by @yukiiiteru in #574
Full Changelog: volo-http-0.4.0-rc.1...volo-http-0.4.0-rc.2
Volo-HTTP 0.4.0-rc.1
What's Changed
In the previous implementation, for the sake of performance, we used a lot of generics in the Client and minimized the use of Box. However, we found that this would make the Client too complicated and the Client-related errors difficult to understand.
To avoid the Client type being too complicated, we used Box in the outermost layer to wrap the inner dyn Future, which would not have a high performance overhead while ensuring that the type is simple and easy to use.
Break Changes
- The complex type aliases have been removed, including:
ClientMetaServiceClientServiceSimpleClientDefaultClientOuterServiceDefaultClient
- Generic types of
Clienthas been changed from inner service (S) to request body and response body (ReqBodyandRespBody).- In most cases, users can use
Clientdirectly and ignore the generic types.
- In most cases, users can use
Others
This PR adds a debugging layer for unit tests. It will dump request and response via println, and if any unit test fails, cargo will print its output by default.
Detailed commits
- fix(examples): fixed http-tls examples by @eternaphia in #564
- fix(volo-http): fix
clippy::result_large_errby @yukiiiteru in #568 - chore(volo-http): Wrap client service by
Boxby @yukiiiteru in #572
New Contributors
- @eternaphia made their first contribution in #564
Full Changelog: volo-http-0.3.1...volo-http-0.4.0-rc.1
Volo-Thrift 0.10.7
What's Changed
- feat: don't log broken pipe error on server by default by @PureWhiteWu in #548
Full Changelog: volo-thrift-0.10.6...volo-thrift-0.10.7
Volo 0.10.5
What's Changed
- fix(volo-build): escape keywords in code generation for idl service method arguments by @Ggiggle in #496
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore: add tests by @Millione in #498
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExtby @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore: fix new clippy rule
empty_line_after_doc_commentsby @yukiiiteru in #505 - chore(volo-http): wrap
hyper::body::IncomingbyBodyby @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- chore(volo-grpc): fix clippy rule needless_lifetimes by @yukiiiteru in #507
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Resultin client by @yukiiiteru in #509 - fix(volo-cli): use the raw given path of local idl file by @Ggiggle in #502
- feat(http): add multipart for server by @StellarisW in #511
- chore: fix nightly clippy rule
needless_lifetimesby @yukiiiteru in #516 - fix(volo): make sure hotrestart sockdir exists by @Millione in #517
- feat(http): add cookie feature for client by @StellarisW in #512
- chore(ci): do not use
aptfor self-hosted runners by @yukiiiteru in #518 - chore(volo-http): implement
sourceforErrors by @yukiiiteru in #519 - fix(volo-build): not add vologen prefix for method arguments type with rust type kind by @Ggiggle in #520
- chore(ci): temporarily disable linux aarch64 tests by @PureWhiteWu in #521
- chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore: update dependency to latest by @PureWhiteWu in #524
- fix(#515): codegen and default problem by @PureWhiteWu in #525
- chore(volo-thrift): fix clippy warning
needless_as_bytesby @yukiiiteru in #529 - chore(volo-http): refactor
ClientBuilder,TargetandCallOptby @yukiiiteru in #528 - chore(volo-http): add feature
json-utf8-lossyby @yukiiiteru in #530 - chore(volo-http): fix previously missed changes to
Bodyby @yukiiiteru in #531 - fix(volo-http): fix wrong rule of setting header
Hostby @yukiiiteru in #532 - chore(volo-http): combine C/S Request and C/S Response types by @yukiiiteru in #534
- chore(volo-build): fix clippy warning
unnecessary_map_orby @yukiiiteru in #536 - feat(volo-http): add client ip by @StellarisW in #535
- chore(volo-http): introduce
hyper_util::server::autoby @yukiiiteru in #537 - fix(volo-http): add mime parsing in server, do not always prefer ipv4 in client dns by @yukiiiteru in #538
- Add an option to split generated pilota files by @missingdays in #510
- chore(volo-http): format codes of client ip by @yukiiiteru in #539
- chore(volo-http): put client_ip to cx.ext by @yukiiiteru in #541
- Split grpc generated files into several files by @missingdays in #540
- chore(volo): bump volo to 0.10.4 by @yukiiiteru in #544
- ci: use self-hosted runners by @PureWhiteWu in #546
- fix(volo-thrift): clean waiters while failed waiting for idle connection by @Millione in #547
- feat: don't log broken pipe error on server by default by @PureWhiteWu in #548
New Contributors
- @missingdays made their first contribution in #510
Full Changelog: volo-0.10.3...volo-0.10.5
volo-thrift-0.10.6
What's Changed
- chore(volo-thrift): fix clippy warning
needless_as_bytesby @yukiiiteru in #529 - fix(volo-thrift): clean waiters while failed waiting for idle connection by @Millione in #547
Full Changelog: volo-thrift-0.10.5...volo-thrift-0.10.6
Volo-HTTP 0.3.0
What's Changed
Notable Changes
Since Volo-HTTP 0.2.14
Bugfix
- Fixed the issue where the
Formwas rejected due to incorrect judgment #538 - Fixed an issue where DNS resolution would always prefer IPv4 addresses #538
Break Changes
Adjust positions of some mods #499
Because the positions of the modules were confusing before, we adjusted the positions of some modules for a better user experience.
volo_http::json::Json->volo_http::server::extract::Jsonvolo_http::extension::Extension->volo_http::utils::Extensionvolo_http::cookie::CookieJar->volo_http::utils::cookie::CookieJar
In addition, Json and Extension were not be re-exported in volo_http, user should import them by its full path.
All Bodys (http_body::Body) are unified into volo_http::body::Body #504
For a more unified experience, we wrap hyper::body::Incoming by volo_http::body::Body, and default generic types of Router, MethodRouter, Route and FromRequest have been updated from Incoming to Body.
And because Body is unified, ClientRequest and ServerRequest are unified into Request, and ClientResponse and ServerResponse are unified into Response. Currently XxxRequest and XxxResponse are not removed, but marked as deprecated.
If you are using Router (and MethodRouter, Route) and specify Incoming as its generic type, update it to Body or remove the generic type directly.
If you implemented FromRequest without use generic type (use default generic type), the argument type should be updated.
If you used ServerRequest and ClientRequest, replace it to Request. If you used ServerResponse and ClientResponse, replace it to Response.
// old
let _: Router<Incoming> = Router::new().route(...);
// new
let _: Router<Body> = Router::new().route(...);
// or remove generic type
let _: Router = Router::new().route(...);// old
impl FromRequest for Foo {
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: Incoming,
) -> Result<Self, Self::Rejection> {
}
}
// new
impl FromRequest for Foo {
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: Body,
) -> Result<Self, Self::Rejection> {
}
}
// or use generic type B
impl<B> FromRequest<B> for Foo
where
B: Body + Send,
B::Data: Send,
B::Error: Send,
{
type Rejection = ...;
async fn from_request(
cx: &mut ServerContext,
parts: Parts,
body: B,
) -> Result<Self, Self::Rejection> {
}
}Most client methods no longer return Result #509
For a better user experience, we changed the return value of some methods of client that originally returned Result<Self> to Self.
In other words, chain calls can be used fluently without adding unwrap, expect or ? in between, they can be removed.
// old
let _ = client.get("http://example.com/").unwrap().send().await;
// new
let _ = client.get("http://example.com/").send().await;Refactor ClientBuilder, Target and CallOpt #522 #528
In order to make the service function more independent, and unify the user experience of Volo-Thrift, Volo-gRPC and Volo-HTTP, while retaining the characteristics of Volo-HTTP, we refactored ClientBuilder, Target and CallOpt.
ClientBuilder::caller_nameandClientBuilder::callee_nameare renamed toClientBuilder::user_agentandClientBuilder::default_hostClientBuilder::fail_on_statushas been removed, you should useFailOnStatuslayer insteadRequestBuilder::set_request_timeouthas been removed, users should useRequestBuilder::with_calloptandCallOpt::new().with_timeout(...)instead
// old
let mut builder= ClientBuilder::new();
builder.caller_name(...).callee_name(...).fail_on_status(...);
let client = builder.build();
client.get(...).set_request_timeout(...).send().await;
// new
let mut builder= ClientBuilder::new();
builder.user_agent(...).default_host(...).layer_outer(FailOnStatus::xxx());
let client = builder.build();
client.get(...).with_callopt(CallOpt::new().with_timeout(...)).send().await;And if you are using customized service discover, you should also pay attention to the following changes:
TargetParserhas been removed, you should implementvolo::client::Applyfor your service discover
Detailed Pull Requests
- chore(volo-http): add docs for test helpers by @yukiiiteru in #497
- chore(volo-http): adjust positions of some mods by @yukiiiteru in #499
- chore(volo-http): refactor
RequestPartsExtby @yukiiiteru in #501 - chore(volo-http): refactor websocket by @yukiiiteru in #503
- chore(volo-http): wrap
hyper::body::IncomingbyBodyby @yukiiiteru in #504 - chore(volo-http): add mock transport service for client by @yukiiiteru in #506
- feat(http): avoid unnecessary router params vec expansion by @StellarisW in #508
- chore(volo-http): use less
Resultin client by @yukiiiteru in #509 - feat(http): add multipart for server by @StellarisW in #511
- feat(http): add cookie feature for client by @StellarisW in #512
- chore(volo-http): implement
sourceforErrors by @yukiiiteru in #519 - chore(volo-http): add TimeoutLayer and FailOnStatus layer by @yukiiiteru in #522
- chore(volo-http): refactor
ClientBuilder,TargetandCallOptby @yukiiiteru in #528 - chore(volo-http): add feature
json-utf8-lossyby @yukiiiteru in #530 - chore(volo-http): fix previously missed changes to
Bodyby @yukiiiteru in #531 - fix(volo-http): fix wrong rule of setting header
Hostby @yukiiiteru in #532 - chore(volo-http): combine C/S Request and C/S Response types by @yukiiiteru in #534
- feat(volo-http): add client ip by @StellarisW in #535
- chore(volo-http): introduce
hyper_util::server::autoby @yukiiiteru in #537 - fix(volo-http): add mime parsing in server, do not always prefer ipv4 in client dns by @yukiiiteru in #538
Full Changelog: volo-http-0.2.14...volo-http-0.3.0