0.88.0 release notes
3rd July 2019
New features
ClientRequestContext.current()
andServiceRequestContext.current()
have been added so you don't need to downcastRequestContext
toClientRequestContext
orServiceRequestContext
. It also makes sure the current context is client-side (or server-side), preventing aClassCastException
. #1869 #1872ClientRequestContext cctx = ClientRequestContext.current(); ServiceRequestContext sctx = ServiceRequestContext.current();
currentOrNull()
static method has been added to(Client|Service)RequestContext
, which is similar tocurrent()
but returningnull
when there's no current context. #1872// Before: RequestContext ctx = RequestContext.mapCurrent(Function.identity(), null); // After: ServiceRequestContext sctx = ServiceRequestContext.currentOrNull();
- You can now specify different
AccessLogWriter
s for different services. #1866Server server = new ServerBuilder() .route().path("/svc1") .accessLogWriter(accessLogWriterForService1, true) .build(service1) .route().path("/svc2") // Will use the fallbackAccessLogWriter. .build(service2) .accessLogWriter(fallbackAccessLogWriter, true) .build();
- The metrics of the
Executor
specified inServerBuilder.blockingTaskExecutor()
will be exposed underexecutor{name=armeriaBlockingTaskExecutor}
. #1683 #1841 - Armeria client will send a DNS query via TCP when a DNS response is truncated due to UDP packet size limitation. #1873
- You can now specify health check request interval using a
Backoff
, which means you can have more flexible delay strategy such as adding jitter. #1846HttpHealthCheckedEndpointGroup group = new HttpHealthCheckedEndpointGroup(...) .retryBackoff(Backoff.fixed(10000).withJitter(0.3)) .build();
- By default,
HealthCheckedEndpointGroup
will now add 20% jitter to the health check request interval.
- By default,
- A new module
armeria-brave
has been added to replace the deprecatedarmeria-zipkin
. #1840- The package name has been changed from
com.linecorp.armeria.{common,client,server}.tracing
tocom.linecorp.armeria.{common,client,server}.brave
. HttpTracingClient
andHttpTracingService
have been renamed toBraveClient
andBraveService
.
- The package name has been changed from
- You can now retrieve the
retrofit2.Invocation
object associated with the current Retrofit call viaInvocationUtil.get(RequestLog)
, which can be useful when building a meter ID prefix. #1591 #1845public class MyRetrofitMeterIdPrefixFunction implements MeterIdPrefixFunction { @Override public MeterIdPrefix apply(MeterRegistry registry, RequestLog log) { final Invocation invocation = InvocationUtil.getInvocation(log); final String service; final String method; if (invocation != null) { service = invocation.method().getDeclaringClass().getSimpleName(); method = invocation.method().getName(); } else { service = "unknown"; method = log.method().name(); } return new MeterIdPrefix("call", "service", service, "method", method); } }
- We also added
RetrofitMeterIdPrefixFunction
which provides the sensible defaultMeterIdPrefixFunction
for Retrofit calls.
- We also added
Improvements
- The content negotiation logic has been relaxed so that the server falls back to the service with less constraint when content negotiation fails. Previously, it was rejecting the request. #1860
- More exceptions are now wrapped by
UnprocessedRequestException
to indicate whether the request can be safely retried without worrying about sending the request more than once. #1653 #1848- Any exceptions that occurred during a connection attempt.
- Any exceptions that occurred during acquiring an existing connection from a connection pool.
- We also made
UnprocessedRequestException.getCause()
is non-null, so you do not need to worry about the case where there is no cause inUnprocessedRequestException
.
Bug fixes
- Server will now allow specifying a
@Default
annotation withnull
value. #1858 #1864 - The
DEBUG
level log message which occurs when a client sent an ill-formedAccept
header is now easier to understand. #1849 THttpService
now handlesHttpStatusException
andHttpResponseException
correctly, which means they will not be translated into a200 OK
response that contains aTApplicationException
anymore. For example, your Thrift clients will see503 Service Unavailable
response when your service throws anHttpStatusException.of(503)
rather than200 OK
. #1839 #1867DocService
debug form will validate the endpoint path properly now. #1856 #1857RequestContextCurrentTraceContext
now callsdecorateScope()
when necessary. #1840- Spring Web and WebFlux integration do not ignore the
ssl.keyAlias
property anymore. #1843 #1865 - You will not see an
ERROR
log message when a client sends aHEAD
request to your Spring WebFlux endpoint. #1847 #1859
Deprecations
HttpHealthCheckedEndpointGroupBuilder.retryInterval(Duration)
has been deprecated. UseretryBackoff(Backoff)
. #1846- Everything in
armeria-zipkin
has been deprecated. Usearmeria-brave
. #1840
Dependencies
- Brave 5.6.3 -> 5.6.6
- FastUtil 8.2.2 -> 8.2.3
- Hibernate Validator 6.0.16 -> 6.0.17
javax.annotation-api
->jakarta.annotation-api
1.3.4- Jetty 9.4.18 -> 9.4.19
- Micrometer 1.1.4 -> 1.2.0
- Netty 4.1.34 -> 4.1.37
- TCNative BoringSSL 2.0.23 -> 2.0.25
- protobuf-jackson 0.4.0 -> 1.0.0
- RxJava 2.2.9 -> 2.2.10
- Spring Boot 2.1.5 -> 2.1.6