0.91.0 release notes

6th September 2019

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 existing Armeria client when creating an Armeria Retrofit 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

  • 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