Skip to content

armeria-0.55.0

Choose a tag to compare

@trustin trustin released this 28 Nov 07:00

Note: Use Armeria 0.55.1.

Breaking changes

  • #795 Updated Brave from 4.6.0 to 4.9.2
  • #823 Updated Micrometer from 0.10.0 to 1.0.0-rc.4
  • #797 The method signature of EndpointSelector.select() has been changed.
  • #849 StreamMessage.closeFuture() has been renamed to completionFuture().
  • #860 StreamMessage.subscribe(..., Executor, ...) has been replaced with subscribe(..., EventExecutor, ...).
    • You need to specify an EventLoop or an EventExecutor instead of a plain Executor.
  • #860 StreamMessage now always invokes its Subscriber from an EventExecutor (or an EventLoop), even if a user did not specify any EventExecutor with subscribe(). Previously, the Subscriber, which subscribed without an Executor, was invoked from the same thread with the publisher, but this is not always true anymore.
    • This change may affect your unit tests which performs stream publication from non-EventLoop threads due to the timing issues introduced by this change.

New features

  • #804 StickyEndpointSelectionStrategy

    ToLongFunction<ClientRequestContext> hasher = (ClientRequestContext ctx) -> {
        return ((HttpRequest) ctx.request()).headers().get(AsciiString.of("cookie")).hashCode();
    };
    EndpointGroupRegistry.register(
            "myGroup", new StaticEndpointGroup(Endpoint.of("foo.com", 80), Endpoint.of("bar.com", 80)),
            new StickyEndpointSelectionStrategy(hasher));
  • #807 Clients.withContextCustomizer() which allows a user change the properties of a ClientRequestContext without using a decorator:

    try (SafeCloseable ignored = Clients.withContextCustomizer(ctx -> {
        ctx.attr(USER_ID).set(userId);
        ctx.attr(USER_SECRET).set(secret);
    })) {
        client.executeSomething(..);
    }
  • #813 HttpHeaderNames.LINK has been added.

  • #824 @Decorator annotation which decorates an annotated service:

    public class MyAnnotatedService {
        @Get("/my_service")
        @Decorator(MyFirstDecorator.class)
        @Decorator(MySecondDecorator.class)
        public String myService(ServiceRequestContext ctx, HttpRequest req) { ... }
    }
  • #825 @Header annotation which injects an HTTP header value for an annotated service:

    public class MyAnnotatedService {
        @Get("/some_resource")
        public String aHeader(@Header("if-match") String ifMatch) { ... }
    }
  • #829 #837 Additional configuration properties for HTTP/1-related limits:

    final ClientFactory cf = new ClientFactoryBuilder()
            .maxHttp1InitialLineLength(8192)
            .maxHttp1HeaderSize(16384)
            .maxHttp1ChunkSize(16384)
            .build();
    final ServerBuilder sb = new ServerBuilder()
            .maxHttp1InitialLineLength(8192)
            .maxHttp1HeaderSize(16384)
            .maxHttp1ChunkSize(16384);
  • #835 Allow specifying remote service name for a Zipkin span when using HttpTracingClient.

  • #847 @ExceptionHandler annotation which allows a user handle an exception conveniently:

    @ExceptionHandler(MyExceptionHandlerFunction.class)
    public class MyAnnotatedService {
        @Get("/users/{id}")
        ...
    }
    
    public class MyExceptionHandlerFunction implements ExceptionHandlerFunction {
        @Override
        public HttpResponse handle(RequestContext ctx, HttpRequest req, Throwable cause) { ... }
    }
  • #855 EventLoopStreamMessage which is an alternative experimental StreamMessage implementation faster than DefaultStreamMessage in certain cases.

Improvements

  • #820 Performance improvements for content type matching in GrpcService
  • #836 #860 #863 Various performance improvements for DefaultStreamMessage
  • #861 It is now allowed to return null in an annotated service method.
  • #862 RequestLogBuilder.endResponse() will use RpcResponse.cause() as the response failure cause automatically if possible.

Bug fixes

  • #811 Zipkin spans are not opened or closed correctly due to a race condition.
  • #839 KeeperException.NoNodeException in ZooKeeperConnector due to a race condition
  • #841 #842 #843 #848 #853 #858 #859 Various bug fixes for StreamMessage implementations

Dependencies

  • Caffeine 2.5.6 -> 2.6.0
  • Guava 23.2 -> 23.4
  • Netty 4.1.16 -> 4.1.17
    • TCNative BoringSSL 2.0.6 -> 2.0.7
  • Brave 4.6.0 -> 4.9.2
  • Kafka 0.11.0.1 -> 1.0.0
  • ZooKeeper 3.4.10 -> 3.4.11