1.21.0 release notes

22nd December 2022

🌟 New features

  • You can now use @RequestTimeout to set a request timeout to annotated services and gRPC services. #4463 #4499

    import com.linecorp.armeria.server.annotation.decorator.RequestTimeout;
    
    @RequestTimeout(value = 1, unit = TimeUnit.SECONDS) // 👈👈👈
    class MyAnnotationService {
      // A request gets timed out after 1 second.
      @Get("/fast/api")
      public CompletableFuture<MyResponse> fastApi() {
        ...
      }
    
      // A request gets timed out after 5 seconds.
      @RequestTimeout(value = 5, unit = TimeUnit.SECONDS) // 👈👈👈
      public CompletableFuture<MyResponse> slowApi() {
        ...
      }
    }
  • You can now set the default MeterRegistry by implementing a custom FlagsProvider. #4541

    public class CustomFlagsProvider implements FlagsProvider {
      @Override
      public MeterRegistry meterRegistry() {
        return PrometheusMeterRegistries.newRegistry(); // 👈👈👈
      }
    }
  • You can now set the default HttpHeaders to Server, VirtualHost and Service. #4520

    static AsciiString CUSTOM_HEADER =
      HttpHeaderNames.of("x-custom-header");
    
    Server
      .builder()
      .setHeader(CUSTOM_HEADER, "server-default-header")
      .virtualHost("foo.com")
      .setHeader(CUSTOM_HEADER, "vhost-default-header").and()
      .route()
      .path("/foo")
      .setHeader(CUSTOM_HEADER, "service-default-header")
  • You can now set :authority or Host header whose value is different from Endpoint.host() using ClientBuilder.setHeader(). #4440 #4520

    • This will be useful when you want to send a request through a proxy server.
    WebClient
      // A request is sent to 'reverse-proxy.example.com'.
      .builder("http://reverse-proxy.example.com/")
      // but 'my-order.service.com' is used for the ':authority' header.
      .setHeader(HeaderNames.AUTHORITY, "my-order.service.com")
      ...
  • CircuitBreakerClient can now be used with arbitrary CircuitBreaker implementations. #4426

  • Added Bytes that represents binary data. #4505

  • You can now see the description of services in the overview section of DocService. #4480 #4537

  • You can now override an authority of a gRPC client using CallOptions. #4445 #4520

📈 Improvements

🛠️ Bug fixes

🏚️ Deprecations

  • N/A

☢️ Breaking changes

  • FieldInfo.childFieldInfo has been removed to eliminate duplicate information on StructInfo. #4566

⛓ Dependencies

  • Apache Curator 5.3.0 → 5.4.0
  • Brave 5.14.0 → 5.14.1
  • Dropwizard 2.1.1 → 2.1.4
  • Eureka 1.10.17 → 2.0.0
  • GraphQL Java 19.2 → 20.0
  • Jackson 2.13.4 → 2.14.1
  • java-jwt 4.0.0 → 4.2.1
  • Jetty 9.4.48 → 9.4.50
  • Kafka client 3.3.0 → 3.3.1
  • Kotlin 1.7.20 → 1.7.22
  • Micrometer 1.9.4 → 1.10.2
  • Netty 4.1.82 → 4.1.86
    • io_uring 0.0.15 → 0.0.16
  • Reactor 3.4.23 → 3.4.26
  • Sangria 3.3.0 → 3.4.1
  • Sangria slowlog 2.0.4 → 2.0.5
  • Scala 2.13.9 → 2.13.10
  • scala-collection-compat 2.8.1 → 2.9.0
  • ScalaPB 0.11.11 → 0.11.12
  • Tomcat 8.5.81 → 8.5.84, 9.0.65 → 9.0.70
  • ZooKeeper 3.6.3 → 3.7.1

🙇 Thank you