You're seeing the release note of an old version. Check out the latest release note.
v1.24.0
June 15, 2023
🌟 New features
-
Unix Domain Socket Support: You can now use Unix domain socket to serve and send requests which is useful for configuring a service mesh to communicate with a sidecar. #1837 #4846
import com.linecorp.armeria.common.util.DomainSocketAddress;
DomainSocketAddress domainSocketAddress =
DomainSocketAddress.of(Paths.get("/tmp/armeria.sock"));
Server
.builder()
.http(domainSocketAddress)
...
.build();
WebClient
.builder("http://" + domainSocketAddress.authority())
...
.build(); -
WebSocket Support: You can now send and receive data over WebSocket using
WebSocketService. #1076 #3904Server
.builder()
.service("/chat", WebSocketService.of((ctx, messages) -> {
WebSocketWriter webSocketWriter = WebSocket.streaming();
// Write frames using back pressure.
return webSocketWriter;
})); -
Customizable Logging: You can now use
LogFormatterandLogWriterto customize the log format and consumer. #3918 #4267 #4943// Convert RequestLog to JSON.
LogFormatter logFormatter = LogFormatter.ofJson();
LogWriter logWriter =
LogWriter
.builder() // Use SLF4J logger for logging.
.logFormatter(logFormatter)
.logger(logger)
.build();
LoggingClient
.builder()
.logWriter(logWriter)
.newDecorator(); -
BlockHound Integrations: Armeria now provides BlockHound integrations, offering enhanced support for detecting with blocking calls in event loops. #4493
-
Delayed Request Abortion: You can now delay aborting the
HttpRequestwhen theHttpResponsecompletes. This may be useful when you want to send additional data even after the response is complete. #4913Server
.builder()
.requestAutoAbortDelayMillis(2000) // Delay aborting the request for 2 second.
...
.build();
WebClient
.builder()
.requestAutoAbortDelayMillis(1000) // Delay aborting the request for 1 second.
...
.build(); -
Circuit Breaker and Retry Rule for timeout: You can now use
RetryRule.onTimeoutException()andCircuitBreakerRule.onTimeoutException()to open the circuit or retry the request when the response is timed out. #4876 #4882 -
Customizable ExecutionId for GraphQL-Java: You can now customize
ExecutionIdof GraphQL-Java usingGraphqlServiceBuilder.executionIdGenerator(). #4867 #4877GraphqlService
.builder()
.executionIdGenerator((requestCtx, query, operation, graphqlCtx) -> {
return ExecutionId.from(requestContext.headers.get("traceparent"));
})
...
.build(); -
Custom CoroutineContext for gRPC-Kotlin: You can now inject a custom
CoroutineContextfor gRPC-Kotlin withCoroutineContextProvider. #4842 #4866class CustomCoroutineContextProvider : CoroutineContextProvider {
override fun provide(ctx: ServiceRequestContext): CoroutineContext {
return ... // A custom CoroutineContext
}
}tipNote that a custom
CoroutineContextProvidershould be registered via Java SPI toMETA-INF/services/com.linecorp.armeria.common.kotlin.CoroutineContextProvider. -
Retrieving CallOptions with GrpcCallOptions: With
GrpcCallOptionsin Armeria, you can now easily retrieveCallOptionsfrom a givenRequestContext. #4776 #4822GrpcClients
.builder(grpcServerUri)
.decorator((delegate, ctx, req) -> {
CallOptions options = GrpcCallOptions.get(ctx);
MyOption myOption = options.getOption(myOptionKey);
// act on myOption if needed
...
return delegate.execute(ctx, req);
})
.build(MyGrpcStub.class); -
Fallback Strategy for CircuitBreakerClient: You can now easily set a fallback strategy to
CircuitBreakerClientwhen aCircuitBreakeris open. #4800 #4818CircuitBreakerClient
.builder(...)
.recover((ctx, req) -> {
// A fallback response when the circuit is open.
return HttpResponse.of(...);
}); -
Netty ChannelPipeline Customizer: You can now customize the Netty
ChannelPipelinefor the server side #4710 #4813Server
.builder()
.childChannelPipelineCustomizer(pipeline -> {
// Add a custom handler to the pipeline.
})
.build(); -
HTTP/2 over TLS without ALPN: Armeria now supports using HTTP/2 over TLS without the need for ALPN. #4702 #4704
ClientFactory
.builder()
.useHttp2WithoutAlpn(true)
...
.build(); -
Armeria with Jetty: Armeria is now compatible with Jetty 10 and Jetty 11. #4845
-
Armeria with Thrift: Armeria is now compatible with Thrift 0.18.1. #4812
📈 Improvements
RequestContext.makeContextAware()now returns instances ofContextAwareRunnable,ContextAwareCallable,ContextAwareFunction,ContextAwareBiFunction,ContextAwareConsumerandContextAwareBiConsumer. #4878 #4890- Annotated services now perform as fast as functional-style services under the following conditions: #4888
- The annotated method returns an
HttpResponse. - The annotated method is run on the event loop (i.e. not annotated with
@Blocking).
- The annotated method returns an
- You can now use the following features with Spring Boot Actuator integration. #4874 #4880
management.endpoints.web.exposure.*management.endpoints.web.path-mapping.*management.endpoints.web.discovery.*management.endpoint.health.status.http-mapping.*application/vnd.spring-boot.actuator.v3+json,application/vnd.spring-boot.actuator.v2+jsonandapplication/json
- Armeria client now exports metrics for
RetryingClientwith the following metric name: #3350 #4707armeria.client.actual.requests.attempts
- You can now set the default log name for
VirtualHostviaVirtualHostBuilder.defaultLogName()#4817 - Synchronized blocks in
core/commonhave been migrated toReentrantLockfor improved compatibility with virtual threads. #4578 - We did groundwork for supporting PKCS#12 and JKS keystore formats when configuring TLS in a future release. #4801
🛠️ Bug fixes
WebClientno longer decodes a percent-encoded?(%3F) in a request path. #4907- Search domains are no longer used in DNS resolution when an authority ends with a trailing dot. #4538 #4875
FailFastExceptionis now correctly converted toStatus.UNAVAILABLEin gRPC clients. #4805 #4924DocServicenow correctly makes the link toStructInfoeven when a protobufMessageis used in both gRPC services and annotated services. #4885ConcurrencyLimitingClientused withRetryingClientorCircuitBreakerClientnow doesn't produce a deadlock. #4826 #4834connection: closeis set correctly in the response when an HTTP/1.1 request containsconnection: close. #4864- You no longer see
NullPointerExceptionwhen usingStreamMessage.mapError()#4852 #4859 DocServicenow correctly generates specifications for Thrift services compiled withjava:fullcameloption. #4858DocServicewith relative paths now correctly provides autocompletion. #4840- The unhandled exception reporter no longer reports ignorable exceptions. #4861 #4922
- Fixed an issue where
@Paramannotation swallows exceptions raised fromRequestConverterFunction. #4826 #4834 armeria-logbackis now compatible with Logback 1.3.x. #4855 #4856CoroutineServerInterceptornow correctly propagates the coroutine context. #4889 #4894- Armeria gRPC client now respects
CallOptions.getExecutor(). #4850 #4851 GraphQlServicenow createsDataLoaderRegistryfor each request. #4237 #4455- Fixed a regression where "Copy as a cURL command" and "Copy response" in debug page did not work. #4929
THttpServiceno longer exposes field information in the response when failing to deserialize a request. #4953
📃 Documentation
- Added documentation for setting request timeouts at the server side. #4595 #4860
- Added documentation for Kotlin integration with Armeria. #4866
- Mentioned http4s-armeria as a part of the Scala integration. #4919 #4920
🏚️ Deprecations
- The following APIs have been deprecated in favor of
LogWriterBuilder:
☢️ Breaking changes
- Changed the return type of
RequestContext.localAddress()andRequestContext.remoteAddress()fromSocketAddresstoInetSocketAddressbecauseDomainSocketAddressis now anInetSocketAddress. #4846 - The parameter type of the following methods has been changed from
SocketAddresstoInetSocketAddress: #4846 - An innermost
MetricCollectingServiceis now chosen to measure metrics for a service. #4908- Previously, the outermost one was used to collect metrics.
⛓ Dependencies
- Brave 5.15.0 → 5.16.0
- Brotli4J 1.11.0 → 1.12.0
- Curator 5.4.0 → 5.5.0
- Dropwizard 2.1.5 → 2.1.6
- Dropwizard Metrics 4.2.18 → 4.2.19
- GraphQL Java 20.0 → 20.4
- GraphQL Kotlin 6.4.0 → 6.5.2
- gRPC-Java 1.49.1 → 1.56.0
- Jackson 2.14.2 → 2.15.2
- java-jwt 4.3.0 → 4.4.0
- Jetty 9.4.50.v20221201 -> 9.4.51.v20230217, 10.0.15, 11.0.0
- Kafka client 3.4.0 → 3.4.1
- Kotlin 1.8.10 → 1.8.22
- Kotlin Coroutine 1.6.4 → 1.7.1
- Micrometer 1.10.5 → 1.11.1
- Netty 4.1.91 → 4.1.93
- io_uring 0.0.19 → 0.0.21
- Protobuf 3.21.1 -> 3.22.3
- protobuf-jackson 2.0.0 → 2.2.0
- Reactive gRPC 1.2.3 → 1.2.4
- Reactor 3.5.1 → 3.5.7
- Sangria 3.5.3 → 4.0.0
- Sangria slowlog 2.0.5 → 3.0.0
- Scala 2.12.17 → 2.12.18, 2.13.10 → 2.13.11, 3.2.2 → 3.3.0
- scala-collection-compat 2.9.0 → 2.10.0
- Spring 6.0.6 → 6.0.9
- Spring Boot 2.7.10 → 2.7.12, 3.0.5 → 3.1.0
- Tomcat 10.1.4 → 10.1.10
- Thrift 0.18.1
🙇 Thank you
This release was possible thanks to the following contributors who shared their brilliant ideas and awesome pull requests:





























