Skip to content

armeria-0.48.0

Choose a tag to compare

@minwoox minwoox released this 20 Jun 09:50

New features

  • (Breaking) #581 #589 DynamicHttpService is merged into the core. Also, HTTP parameters are automatically injected as arguments when calling an annotated service method. Your code will fail to compile if you wrote your service using DynamicHttpService.
    • DynamicHttpServiceBuilder class is removed. You can use ServerBuilder.annotatedService(...) to add an annotated service object to the builder as follows:
      ServerBuilder sb = ...;
      // Using a query parameter (e.g. /greet5?name=alice) on an annotated service object:
      sb.annotatedService(new Object() {
          @Get("/greet5")
          public HttpResponse greet(@Param("name") String name,
                                    @Param("title") @Optional("Mr.") String title) {
              // "Mr." is used by default if there is no title parameter in the request.
              return HttpResponse.of(HttpStatus.OK, MediaType.PLAIN_TEXT_UTF_8,
                                     "Hello, %s %s!", title, name);
          }
      });
    • @PathParam annotation has been replaced with @param, which is much shorter and handles query parameters as well.
    • The package name of HTTP method anntations, such as @Get, is changed to com.linecorp.armeria.server.http.annotation from com.linecorp.armeria.server.http.dynamic.
  • #584 #585 Provide more ways to specify a path pattern. The following patterns would be accepted as a path pattern.
    • /login (no path parameters)
    • /users/{userId} (curly-brace style)
    • /list/:productType/by/:ordering (colon style)
    • exact:/foo/bar (exact match)
    • prefix:/files (prefix match)
    • glob:/~*/downloads/** (glob pattern)
    • regex:^/files/(?.*)$ (regular expression)
  • #593 Restore prefix mapping stripping to allow it to work together with arbitrarily mapped PathMappingResult. ServiceRequestContext.mappedPath() would return the value from PathMappingResult.path().
  • #611 Move the JVM system property flags to Flags
    • You can now find out what JVM system property options to specify that can change the behavior of Armeria.
  • #599 Simplify type parameters of clients and services by assuming the type parameters are only one of the following
    • HttpReqeust and HttpResponse
    • RpcRequest and RpcResponse
  • #596 Add StreamMessageDuplicator. StreamMessage can be subscribed by multiple subscribers now.
  • #577 Add AggregatedHttpMessage.toHttpRequest/Response()
  • #576 Enable example headers in ThriftServiceRegistrationBean
  • #515 Implement ManagedHttpHealthCheckService, so you can override the healthiness via a PUT request.

Improvements

  • #606 Update dependencies
  • #602 Provide a default value that limits the number of request try attempt
  • #600 Cleanup native transport usages

Bug fixes

  • #595 Fix a leak in DefaultStreamMessage / Improve the life cycle contract of reference-counted objects in StreamMessage.
  • #597 Ensure DefaultStreamMessage cleans up the objects even when demand is 0.
  • #588 Do not cache PathMappingResult when query string exists.
  • #608 Ensure an HTTP object is requested after reading headers in a gRPC stream.
  • #590 Remove exception throwing when a context is timed out.
  • #587 Support path parameter names that start with a digit.
  • #578 Rename HttpResponse.ofFailed() to ofFailure().
  • #609 Add missing source files to armeria-tomcat8.0 and armeria-thrift0.9.
  • #592 Allow duplicate docstring keys in grpc docstring extractor.
  • #594 Exclude thrift module dependency from spring-boot-autoconfigure POM to allow a user to choose Thrift version.