armeria-0.57.0
New features
-
#774 #945
RedirectServicewhich sends a redirect response.ServerBuilder sb = new ServerBuilder(); sb.service("/foo/{bar}", new RedirectService("/{bar}/foo")); sb.service("regex:^/old-location/(?<path>.*)$", new RedirectService("/new-location/{path}"));
-
#852 We now provide Maven BOM (Bill of Materials).
-
#935 #949 Annotated services now support
enumparameter types.ServerBuilder sb = new ServerBuilder(); sb.annotatedService(new Object() { @Get("/users/by_type/{userType}") public AggregatedHttpMessage listUsersByType(@Param("userType") UserType userType) { ... } }); public enum UserType { ADMIN, MODERATOR, MEMBER }
-
#943 #979 All packages are now annotated with
NonNullByDefaultannotation so that Armeria is more friendly to the compilers and IDEs that understand JSR305 annotations, such Kotlin and IntelliJ IDEA.-
For Kotlin, add
-Xjsr305=strictor-Xjsr305=truecompiler option, e.g.tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all { kotlinOptions { freeCompilerArgs = ["-Xjsr305=strict"] } }
-
-
#954
PropertiesEndpointGroupwhich loads the endpoint list from a.propertiesfile or aPropertiesProperties props = new Properties(); props.put("example.hosts.0", "example1.com"); props.put("example.hosts.1", "example2.com:8080"); props.put("example.hosts.2", "example3.com:9080"); EndpointGroup myGroup = PropertiesEndpointGroup.of(props, "example.hosts", 80);
-
#965 Add a dangerous option to use
ByteBufHttpDatafor incoming data in gRPC, which yields better throughput when payload is large -
#967 #981 A
Servicenow has more control over the path cache viaService.shouldCachePath().public class MyService implements HttpService { @Override public boolean shouldCachePath(String path, @Nullable String query, PathMapping pathMapping) { // Always cache the path. return true; } ... }
Improvements
- #956
UnframedGrpcServiceimplementsServiceWithPathMappings - #959
RequestLogprioritizes an RPC response exception over a stream exception. - #964 gRPC messages are serialized into
ByteBufHttpDatainstead ofDefaultHttpDatafor fewer memory copies.
Bug fixes
- #951 Incorrect use of
Class.isAssignableFrom()in annotated services - #967 #981 The paths for a prefix path mapping should not be cached by default.
- #968 Zipkin traces are recorded incorrectly when multiples requests interleave.
- #971 #973 Client disconnection is not notified in a bidirectional async gRPC.
- #972 #975
ClientFactory.close()does not close all connections.
Dependencies
- Prometheus and Dropwizard related dependencies are all optional now.
- Brave 4.13.1 -> 4.14.3
- Dropwizard Metrics 3.2.5 -> 4.0.2
- gRPC 1.8.0 -> 1.9.0
- Guava: 23.5-jre -> 23.6-jre
- Jackson 2.9.2 -> 2.9.4
- Jetty: 9.4.7.v20170914 -> 9.4.8.v20171121
- Micrometer 1.0.0-rc.5 -> 1.0.0-rc.9
- Netty: 4.1.19.Final -> 4.1.20.Final
- Prometheus 0.1.0 -> 0.2.0
- Spring Boot 1.5.9 -> 1.5.10
- Tomcat 8.5.24 -> 8.5.27 and 8.0.48 -> 8.0.49
- Zipkin 2.4.2 -> 2.4.5
Known issues
- Netty 4.1.20 has a memory leak - netty/netty#7676