armeria-0.55.0
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 tocompletionFuture(). - #860
StreamMessage.subscribe(..., Executor, ...)has been replaced withsubscribe(..., EventExecutor, ...).- You need to specify an
EventLoopor anEventExecutorinstead of a plainExecutor.
- You need to specify an
- #860
StreamMessagenow always invokes itsSubscriberfrom anEventExecutor(or anEventLoop), even if a user did not specify anyEventExecutorwithsubscribe(). Previously, theSubscriber, which subscribed without anExecutor, 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-
EventLoopthreads due to the timing issues introduced by this change.
- This change may affect your unit tests which performs stream publication from non-
New features
-
#804
StickyEndpointSelectionStrategyToLongFunction<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 aClientRequestContextwithout 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.LINKhas been added. -
#824
@Decoratorannotation 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
@Headerannotation 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
@ExceptionHandlerannotation 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
EventLoopStreamMessagewhich is an alternative experimentalStreamMessageimplementation faster thanDefaultStreamMessagein 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
nullin an annotated service method. - #862
RequestLogBuilder.endResponse()will useRpcResponse.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.NoNodeExceptioninZooKeeperConnectordue to a race condition - #841 #842 #843 #848 #853 #858 #859 Various bug fixes for
StreamMessageimplementations
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