0.99.8 release notes
7th July 2020
🌟 New features
- You can now use
ClientRequestContext
to build a complexRetryRule
andCircuitBreakerRule
. #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
HttpFile
andFileService
asynchronously. #1668 #2845HttpFile httpFile = HttpFile.of(...); CompletableFuture<HttpFileAttributes> attrs = httpFile.readAttributes(CommonPools.blockingTaskExecutor()); CompletableFuture<ResponseHeaders> headers = httpFile.readHeaders(CommonPools.blockingTaskExecutor());
- You can now easily customize
MeterIdPrefixFunction
usingMeterIdPrefixFunction.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
Endpoint
are added toEndpointSelector
and thusEndpointGroup
which 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
EmptyEndpointGroupException
at least for the case where theEndpoints
disappear 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
ResourceLeakDetector
if theDefaultClientFactory
is 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
Host
header to:authority
header anymore. #2846 #2850RequestHeaders.authority()
looks intoHost
header if:authority
header is missing.
FileService
is not blocked byClassLoader
lock anymore. #1668 #2845- You can retry when
DnsTimeoutException
is raised usingRetryRule.onUnprocessed()
. #2836 - You no longer see
Http2Exception: failed to consume a HEADERS frame
error. #2832 - You no longer see
You tried to set the content preview twice
warning unless you really did apply content previewing decorator twice. #2830 #2832 - A non-base
WebClient
respects the user defined scheme correctly. #2835 - The specified port when building
EurekaUpdatingListener
andZooKeeperUpdatingListener
is used in the registration information of an Armeria server. #2826
🏚️ Deprecations
- All Spring registration beans are deprecated. Use
ArmeriaServerConfigurator
andDocServiceConfigurator
instead. #2787 #2838- Deprecated beans:
HttpServiceRegistrationBean
,AnnotatedServiceRegistrationBean
,GrpcServiceRegistrationBean
andThriftServiceRegistrationBean
- Deprecated beans:
MeterIdPrefixFunctionFactory
has been deprecated in favor ofRequestLog.serviceName()
. #2780 #2820executor()
,contextAwareExecutor()
andcontextAwareEventLoop()
methods inRequestContext
are deprecated. #2834on*(Predicate)
methods in the followings classes are deprecated. #2851RetryRule
andRetryRuleBuilder
RetryRuleWithContent
andRetryRuleWithContentBuilder
CircuitBreakerRule
andCircuitBreakerRuleBuilder
CircuitBreakerRuleWithContent
andCircuitBreakerRuleWithContentBuilder
- 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-dropwizard
is nowarmeria-dropwizard2
.armeria-jetty
is nowarmeria-jetty9
.armeria-rxjava
is nowarmeria-rxjava3
.rxjava
package is renamed torxjava3
.
armeria-spring-boot-actuator-autoconfigure
is nowarmeria-spring-boot2-actuator-autoconfigure
.armeria-spring-boot-actuator-starter
is nowarmeria-spring-boot2-actuator-starter
.armeria-spring-boot-autoconfigure
is nowarmeria-spring-boot2-autoconfigure
.armeria-spring-boot-starter
is nowarmeria-spring-boot2-starter
.armeria-spring-boot-webflux-autoconfigure
is nowarmeria-spring-boot2-webflux-autoconfigure
.armeria-spring-boot-webflux-starter
is nowarmeria-spring-boot2-webflux-starter
.armeria-testing-common
has been removed.armeria-testing-junit4
is nowarmeria-junit4
.armeria-testing-junit
is nowarmeria-junit5
.junit
package is renamed tojunit5
.
armeria-thrift
is nowarmeria-thrift0.13
.armeria-tomcat
is nowarmeria-tomcat9
.armeria-zookeeper
is nowarmeria-zookeeper3
.
RequestContext.eventLoop()
now returnsContextAwareEventLoop
which always set theRequestContext
before executing any submitted tasks. #2629 #2834- The default logging level for successful requests and response has been changed. #2696 #2855
INFO
toDEBUG
forLogging{Client,Service}.newDecorator()
TRACE
toDEBUG
forLogging{Client,Service}Builder
- The APIs of
HttpFile
andHttpVfs
have been changed. #1668 #2845 #2861 AggregatedHttpFile
does not extendHttpFile
anymore. #2861AbstractHttpFile.headers()
is nowAbstractHttpFile.additionalHeaders()
. #2861EndpointSelector
API 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.
UserClient
API 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.StepVerifier
instead.
- 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}RequestContext
have 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