Armeria v0.91.0 Release Notes
Release Date: 2019-09-06 // over 4 years ago-
What is Armeria?
Armeria is an open-source asynchronous HTTP/2 RPC/REST client/server library built on top of Java 8, Netty, Thrift and gRPC. Its primary goal is to help engineers build high-performance asynchronous microservices that use HTTP/2 as a session layer protocol. Visit the official web site and follow @armeria_project to check out many cool features you can't find in the official gRPC/Thrift implementation or other microservice frameworks.
๐ New features
You can specify the maximum number of event loops to handle connections. #1886
ClientFactoryBuilder builder = ...; builder.maxNumEventLoopsPerEndpoint(5); // Assign 5 event loops for endpoints. 1 is used by default.builder.maxNumEventLoopsPerHttp1Endpoint(10); // Assign 10 event loops for HTTP/1.1 endpoints. 1 is used by default.// You can set a customized function.builder.maxNumEventLoopsFunction(endpoint -> { if (endpoint.equals(Endpoint.of("foo.com"))) { return 5; } if (endpoint.host().contains("bar.com")) { return Integer.MAX_VALUE; // The value will be clamped at the number of event loops. } return -1; // Should return 0 or a negative value to use the default value.});
โฑ You can now implement your own
EventLoopScheduler
which schedulesEventLoop
s those handle connections. #1886๐ You can now see Armeria modules and their versions in DocService. #685 #1744
You can now easily combine
EndpointGroup
s andEndpoint
s. #1897 #1939Endpoint foo = ...;Endpoint bar = ...;DynamicEndpointGroup group1 = ...;DynamicEndpointGroup group2 = ...;EndpointGroup composite = EndpointGroup.of(foo, bar, group1, group2);
You can use the Fibonacci backoff. #1968 #1979
Backoff backoff = Backoff.fibonacci(100 /* initial delay millis */, 10000 /* max delay millis */);
๐ง You can now reuse the configuration of exising Armeria client when creating an Armeria Retrotit client and
HealthCheckedEndpointGroup
. #2019 #2020HttpClient myClient = ...;ArmeriaRetrofitBuilder builder = new ArmeriaRetrofitBuilder();// Use the same settings and decorators with
myClient
when sending requests.builder.clientOptions(myClient.options());HealthCheckedEndpointGroupBuilder builder2 = new HealthCheckedEndpointGroupBuilder(); builder2.clientOptions(myClient.options());You can unwrap a
Client
and bring the decorating client instance viaUnwrappable.as()
orClientFactory.unwrap()
. #1883 #2018 #2029HttpClient client = new HttpClientBuilder() .decorator(LoggingClient.newDecorator()) .build();LoggingClient unwrapped = client.as(LoggingClient.class).get();LoggingClient unwrapped2 = clientFactory.unwrap(client, LoggingClient.class).get();
You can now easily retrieve the port number of the running server. #1956 #1967
ServerBuilder sb = new ServerBuilder();Server server = sb.http(0) // Use an ephemeral port. .build();...int port = server.activeLocalPort();
๐ Improvements
- ๐ The delay calculation performance in
ExponentialBackoff
is improved. #1983 - You can now run all Armeria examples using
gradle run
orgradle bootRun
. #1988
๐ Bug fixes
- ๐ You no longer see a warning message when the connection is closed before the current session protocol is detected. #2043 #2048
- ๐ป
ByteBufHttpData
does not leak anymore when an exception is raised by a client-side decorator. #2034 - โฌ๏ธ You no longer see a
NullPointerException
when the remote server requires a protocol downgrade. #2010 #2021
๐ฅ Breaking changes
- 0๏ธโฃ Only one HTTP/2 connection is made per endpoint by default. #1886
- Previously, an Armeria client made as many connections as the number of event loops for each endpoint. Now, it creates only one connection per endpoint so one
EventLoop
handles all requests. Because of that, you may see performance degradation. If you want it to work as before, specifymaxNumEventLoopsPerEndpoint
with the number of event loops inClientFactoryBuilder
.
- Previously, an Armeria client made as many connections as the number of event loops for each endpoint. Now, it creates only one connection per endpoint so one
Dependencies
We now use Maven Boms(Bill of Materials) for Jackson, Brave and Netty
- Brave 5.6.10 -> 5.7.0
- Guava 28.0-jre -> 28.1-jre
- Jackson 2.9.9 -> 2.9.9.20190807
- net.shibboleth.utilities 7.3.0 -> 7.5.0
- OpenSAML 3.3.0 -> 3.4.3
- Reactivestreams 1.0.2 -> 1.0.3
- ๐ Reactor 3.2.11.RELEASE -> 3.2.12.RELEASE
- RxJava2 2.2.11 -> 2.2.12
- ๐ Spring boot 2.1.7.RELEASE -> 2.1.8.RELEASE
Thank you
๐ This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests: