armeria-0.68.0
New features
-
A user can customize how Armeria handles duplicate path mappings via
ServerBuilder.rejectedPathMappingHandler(RejectedPathMappingHandler). #1283 #1298ServerBuilder sb = new ServerBuilder(); sb.rejectedPathMappingHandler((virtualHost, mapping, existingMapping) -> { // Do nothing. }); sb.service("/", ...); sb.service("/", ...); // Ignored silently.
-
A user can now specify alternative responses for authorization success and failure when building an
HttpAuthServiceusingHttpAuthServiceBuilder. #506HttpAuthService authService = new HttpAuthServiceBuilder() .addBasicAuth(...) .onSuccess((delegate, ctx, req) -> HttpResponse.of(200)) .onFailure((delegate, ctx, req, cause) -> HttpResponse.of(401)) .build();
-
A user can now build a composite
Authorizerfrom more than oneAuthorizers. #1303Authorizer<HttpRequest> a = ...; Authorizer<HttpRequest> b = ...; Authorizer<HttpRequest> c = ...; Authorizer<HttpRequest> composite = a.orElse(b).orElse(c);
-
Added
EventLoopRuleandEventLoopGroupRulefor easier setup and tear-down ofEventLoopandEventLoopGroupin a JUnit test case. #1304public class MyTest { @ClassRule public static final EventLoopRule eventLoop = new EventLoopRule(); @Test public void runTask() { eventLoop.get().execute(() -> System.err.println("Hello!")); } }
-
Added
RequestContext.executor()andRequestContext.contextAwareExecutor()for potentially easier mocking ofRequestContext#1307 -
The frontend-side implementation of
DocServicehas been rewritten with React, TypeScript and Material UI. #654 #1288 -
A user can now inject an arbitrary JavaScript string into
DocServicepages. It is also possible to inject example HTTP headers ofDocServiceusing JavaScript. This can be useful if you need to set the access token retrieved from browser's local storage to the example HTTP headers or to inject some analytics code. #1312-
For example, a Firebase auth user would just add the following injected script to have debug requests automatically authenticated with a valid access token:
armeria.registerHeaderProvider(function() { return firebase.auth().currentUser.getIdToken() .then(token => { authorization: 'Bearer ' + token }); });
-
-
Added a new system property
com.linecorp.armeria.maxNumConnectionsso that a user can change the default max number of allowed server-side connections. The default value stays unchanged asInteger.MAX_VALUE. #1309 -
Retrofit client now supports HTTP response streaming, as well as waiting for the complete content. Streaming is disabled by default because there's no way to stream a response in a fully asynchronous manner in Retrofit (i.e. blocking calls will be involved). Use
ArmeriaRetrofitBuilder.streaming(boolean)to enable this feature. #1296
Bug fixes
HealthCheckedEndpointGroupdoes not raise an unexpected exception anymore when there are duplicate endpoints to check. #1290- Suppressed duplicated log messages related with TLS handshake. #1297
- Fixed a bug where
Endpoint.toString()does not include an IP address. #1299 - Fixed a bug where gRPC status code is not translated into HTTP status code properly for gRPC-Web. #1252 #1305
- Fixed a bug where
RequestLogdoes not contain gRPC request parameters and return values. #1308- For streaming requests or responses, only the first request or response will be recorded.
- Fixed various notification issues where
RequestLogdoes not reachCOMPLETEavailability for some edge cases. #1308
Breaking changes
HttpAuthServiceis nowfinal. UseHttpAuthServiceBuilderfor its customization. #1303
Dependencies
- Brave 5.1.2 -> 5.1.4
- Dropwizard Metrics 4.0.2 -> 4.0.3
- gRPC 1.13.1 -> 1.13.2
- Kafka 1.1.0 -> 1.1.1
- Micrometer 1.0.5 -> 1.0.6
- Netty 4.1.27 -> 4.1.28
- RxJava 2.1.16 -> 2.1.17
- ZooKeeper 3.4.12 -> 3.4.13