0.99.8 release notes
7th July 2020
🌟 New features
- You can now use
ClientRequestContextto build a complexRetryRuleandCircuitBreakerRule. #2851RetryRuleWithContent.<RpcResponse>builder() .onServerErrorStatus() // Now it's the BiPredicate that takes ctx as well. .onException((ctx, ex) -> { RpcRequest request = ctx.rpcRequest(); if (request != null && !safeMethods.contains(request.method())) { return isRetryableException(throwable); } else { return false; } }) .thenBackoff(backoff); - You can now run the gRPC server/client stubs generated by ScalaPB with Armeria. #2719
- Please refer to the fully working example.
- You can now parse a response trailers from a response body for gRPC-Web using
GrpcWebUtil.parseTrailers(). #2848Clients.builder(...) .decorator(RetryingClient.newDecorator( RetryRuleWithContent.onResponse(response -> { return response.aggregate().thenApply(aggregated -> { HttpHeaders trailers = GrpcWebUtil.parseTrailers(aggregated.content()); // Retry if the 'grpc-status' is not equal to 0. return trailers != null && trailers.getInt(GrpcHeaderNames.GRPC_STATUS) != 0; }); }))) .build(MyGrpcStub.class); - You can now access the metadata of
HttpFileandFileServiceasynchronously. #1668 #2845HttpFile httpFile = HttpFile.of(...); CompletableFuture<HttpFileAttributes> attrs = httpFile.readAttributes(CommonPools.blockingTaskExecutor()); CompletableFuture<ResponseHeaders> headers = httpFile.readHeaders(CommonPools.blockingTaskExecutor()); - You can now easily customize
MeterIdPrefixFunctionusingMeterIdPrefixFunction.andThen(). #2839MeterIdPrefixFunction .ofDefault("hoge") .andThen((registry, log, id) -> id.withTags( "grpc-status", log.responseTrailers().get("grpc-status"))); - Both synchronous and asynchronous APIs to select an
Endpointare added toEndpointSelectorand thusEndpointGroupwhich is a sub-interface. #1910 #2837ClientRequestContext ctx = ... EndpointGroup group = ... // synchronous selection! Endpoint endpoint = group.selectNow(ctx); // asynchronous selection! CompletableFuture<Endpoint> future = group.select(ctx, ctx.eventLoop(), 1000 /* timeout */ );- Thanks to this change, you can now avoid the
EmptyEndpointGroupExceptionat least for the case where theEndpointsdisappear temporarily.
- Thanks to this change, you can now avoid the
- You can now get the snapshot status of circuit breakers from monitoring system. #2841
📈 Improvements
- You can now schedule a request timeout in nanoseconds. #2864
- You can now see the error message by
ResourceLeakDetectorif theDefaultClientFactoryis not closed properly. #2847 - The initial connection latency is lowered by giving up hopeless HTTP/1.1 connection early when HTTP/2 upgrade request fails. #2852
🛠️ Bug fixes
- Armeria server does not convert the
Hostheader to:authorityheader anymore. #2846 #2850RequestHeaders.authority()looks intoHostheader if:authorityheader is missing.
FileServiceis not blocked byClassLoaderlock anymore. #1668 #2845- You can retry when
DnsTimeoutExceptionis raised usingRetryRule.onUnprocessed(). #2836 - You no longer see
Http2Exception: failed to consume a HEADERS frameerror. #2832 - You no longer see
You tried to set the content preview twicewarning unless you really did apply content previewing decorator twice. #2830 #2832 - A non-base
WebClientrespects the user defined scheme correctly. #2835 - The specified port when building
EurekaUpdatingListenerandZooKeeperUpdatingListeneris used in the registration information of an Armeria server. #2826
🏚️ Deprecations
- All Spring registration beans are deprecated. Use
ArmeriaServerConfiguratorandDocServiceConfiguratorinstead. #2787 #2838- Deprecated beans:
HttpServiceRegistrationBean,AnnotatedServiceRegistrationBean,GrpcServiceRegistrationBeanandThriftServiceRegistrationBean
- Deprecated beans:
MeterIdPrefixFunctionFactoryhas been deprecated in favor ofRequestLog.serviceName(). #2780 #2820executor(),contextAwareExecutor()andcontextAwareEventLoop()methods inRequestContextare deprecated. #2834on*(Predicate)methods in the followings classes are deprecated. #2851RetryRuleandRetryRuleBuilderRetryRuleWithContentandRetryRuleWithContentBuilderCircuitBreakerRuleandCircuitBreakerRuleBuilderCircuitBreakerRuleWithContentandCircuitBreakerRuleWithContentBuilder- Use
on*(BiPredicate)methods instead.
RequestLogBuilder.defer*Content*()andisDefer*Content*Set()have been deprecated in favor ofdefer(RequestLogProperty)andisDeferred(RequestLogProperty). #2832MeterIdPrefixFunction.andThen(BiFunction<MeterRegistry, MeterIdPrefix, MeterIdPrefix>is deprecated. #2839UnprocessedRequestException(Throwable)constructor is deprecated. UseUnprocessedRequestException.of()instead. #2836
☢️ Breaking changes
- The names of various artifacts are changed. #2676 #2677 #2829 #2843
armeria-dropwizardis nowarmeria-dropwizard2.armeria-jettyis nowarmeria-jetty9.armeria-rxjavais nowarmeria-rxjava3.rxjavapackage is renamed torxjava3.
armeria-spring-boot-actuator-autoconfigureis nowarmeria-spring-boot2-actuator-autoconfigure.armeria-spring-boot-actuator-starteris nowarmeria-spring-boot2-actuator-starter.armeria-spring-boot-autoconfigureis nowarmeria-spring-boot2-autoconfigure.armeria-spring-boot-starteris nowarmeria-spring-boot2-starter.armeria-spring-boot-webflux-autoconfigureis nowarmeria-spring-boot2-webflux-autoconfigure.armeria-spring-boot-webflux-starteris nowarmeria-spring-boot2-webflux-starter.armeria-testing-commonhas been removed.armeria-testing-junit4is nowarmeria-junit4.armeria-testing-junitis nowarmeria-junit5.junitpackage is renamed tojunit5.
armeria-thriftis nowarmeria-thrift0.13.armeria-tomcatis nowarmeria-tomcat9.armeria-zookeeperis nowarmeria-zookeeper3.
RequestContext.eventLoop()now returnsContextAwareEventLoopwhich always set theRequestContextbefore executing any submitted tasks. #2629 #2834- The default logging level for successful requests and response has been changed. #2696 #2855
INFOtoDEBUGforLogging{Client,Service}.newDecorator()TRACEtoDEBUGforLogging{Client,Service}Builder
- The APIs of
HttpFileandHttpVfshave been changed. #1668 #2845 #2861 AggregatedHttpFiledoes not extendHttpFileanymore. #2861AbstractHttpFile.headers()is nowAbstractHttpFile.additionalHeaders(). #2861EndpointSelectorAPI has been changed. #2837 #1910- It is not a functional interface anymore.
select()has been renamed toEndpointSelector.selectNow().- An asynchronous
EndpointSelector.select()has been added.
UserClientAPI has been changed. #2837- Its constructor requires more parameters.
execute()requires less parameters.
StreamMessage.drainAll()and its variants have been removed. #2782 #2827- They are only used for unit tests and you can use
reactor.test.StepVerifierinstead.
- They are only used for unit tests and you can use
UnprocessedRequestException(String, Throwable)constructor has been removed without replacement. #2836- Deprecated timeout APIs in
{Service,Client}RequestContexthave been removed. #2864extend{Request,Response}TimeoutMillis(long)andextend{Request,Response}Timeout(Duration)set{Request,Response}TimeoutAfterMillis(long)andset{Request,Response}TimeoutAfter(Duration)set{Request,Response}TimeoutAtMillis(long)andset{Request,Response}TimeoutAt(Duration)
⛓ Dependencies
- gRPC-Java 1.30.1 → 1.30.2
- Jackson 2.11.0 → 2.11.1
- Kafka 1.1.1 → 2.5.0
- Micrometer 1.5.1 → 1.5.2
- Reactor 3.3.6 → 3.3.7
- Shaded dependencies
- Caffeine 2.8.4 → 2.8.5
- Examples:
- Dagger 2.28 → 2.28.1
- monix_reactive 3.2.2
- ScalaPB 0.10.6
- Build:
- Checkstyle 8.33 → 8.34
- Eureka 1.9.23 → 1.9.25
- Finagle ServerSets 20.5.0 → 20.6.0
- Gradle 6.5 → 6.5.1
- gRPC-Kotlin 0.1.3 → 0.1.4