1.20.0 release notes

5th October 2022

🌟 New features

  • You can now handle a GraphQL error using GraphqlErrorHandler. #4435

    GraphqlErrorHandler errorHandler = new GraphqlErrorHandler() {
      @Override
      public HttpResponse handle(ServiceRequestContext ctx, ExecutionInput input,
                                 ExecutionResult result, @Nullable Throwable cause) {
        final List<GraphQLError> errors = result.getErrors();
        if (errors.stream().map(GraphQLError::getMessage)
                  .anyMatch(m -> m.startsWith("Unauthorized"))) {
          return HttpResponse.of(HttpStatus.UNAUTHORIZED);
        }
        ...
      }
    };
    GraphqlService
      .builder()
      .schemaFile(...)
      .runtimeWiring(...)
      .errorHandler(errorHandler) // 👈👈👈
      .build();
  • You can now easily configure client-side TLS key and certificates to support mTLS via ClientFactoryBuilder.tls(). #4410

    File keyCertChainFile = ...;
    File keyFile = ...;
    ClientFactory factory =
      ClientFactory
        .builder()
        .tls(keyCertChainFile, keyFile)
        .build();
    WebClient
      .builder()
      .factory(factory)
      .build();
  • gRPC HTTP/JSON transcoding endpoint can now handle both the snake case and camel case query parameters using HttpJsonTranscodingOptions. #4428

    HttpJsonTranscodingOptions options =
      HttpJsonTranscodingOptions
        .builder()
        // Try the original field name and camel case
        // if it's not found via the original name.
        .queryParamMatchRules(LOWER_CAMEL_CASE,
                              ORIGINAL_FIELD)
                              ...
                              .build();
    GrpcService
      .builder()
      .enableHttpJsonTranscoding(options)
      .build();
  • You can now use OutputStream to write data to a StreamMessage using StreamMessage.fromOutputStream(). #4402

    StreamMessage.fromOutputStream(os -> {
      // perform blocking operation
      HttpData data0 = readDataFromBlockingDB(0);
      os.write(data0);
      HttpData data1 = readDataFromBlockingDB(1);
      os.write(data1);
      os.close();
    }
  • You can now convert an AggregatedHttpRequest to an HttpRequest with new headers. #4441

    AggregatedHttpRequest req = ...
    HttpRequest httpRequest = req.toHttpRequest(newHeaders);

📈 Improvements

  • N/A

🛠️ Bug fixes

📃 Documentation

  • N/A

🏚️ Deprecations

☢️ Breaking changes

  • N/A

⛓ Dependencies

You can use Thrift 0.17 with Armeria.

  • Brave 5.13.11 → 5.14.0
  • Dropwizard2 2.1.1 → 2.1.2
  • GraphQL Java 19.0 → 19.2
  • GraphQL Kotlin 6.2.2 → 6.2.5
  • gRPC Java 1.49.0 → 1.49.1
  • Kafka 3.2.1 → 3.3.0
  • Kotlin 1.7.10 → 1.7.20
  • Micrometer 1.9.3 → 1.9.4
  • Netty 4.1.79.Final → 4.1.82.Final
    • io_uring 0.0.14.Final → 0.0.15.Final
  • Reactor 3.4.22 → 3.4.23
  • Sangria GraphQL 3.2.0 → 3.3.0
  • Scala 2.12.16 → 2.12.17, 2.13.8 → 2.13.9
  • Spring Boot 2.7.3 → 2.7.4
  • Thrift 0.17.0 is added

🙇 Thank you