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 schedules EventLoops those handle connections. #1886

    • ๐Ÿ‘€ You can now see Armeria modules and their versions in DocService. #685 #1744
      version

    • You can now easily combine EndpointGroups and Endpoints. #1897 #1939

      Endpoint 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 #2020

      HttpClient 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 via Unwrappable.as() or ClientFactory.unwrap(). #1883 #2018 #2029

      HttpClient 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 or gradle 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, specify maxNumEventLoopsPerEndpoint with the number of event loops in ClientFactoryBuilder.

    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: