What's new in Vert.x 4.4

Vert.x 4.4 comes with few new exciting features.

Here is an overview of the most important features in Vert.x 4.4.

New OpenAPI implementation

A new implementation of OpenAPI using the latest JsonSchema API is available as tech preview. This new implementation allows both OpenAPI 3.0 and OpenAPI 3.1 documents to be used as a foundation for a router.

// the api contract yaml or json
OpenAPIContract contract = getContract();
RouterBuilder routerBuilder = RouterBuilder.create(vertx, contract);
// the ready to mount router that matches the provided contract
Router router = routerBuilder.createRouter();

As well as it allows both input validation, and (as a totally new feature) output validation.

RequestValidator validator = RequestValidator.create(vertx, contract);
 
ValidatableRequest request = getValidatableRequest();
validator.validate(request, "yourOperationId")
  .onSuccess(validatedRequest -> {
    validatedRequest.getBody(); // returns the body
    validatedRequest.getHeaders(); // returns the header
...

And:

ResponseValidator validator = ResponseValidator.create(vertx, contract);
 
JsonObject cat = new JsonObject().put("name", "foo");
ValidatableResponse response =
      ValidatableResponse.create(200, cat.toBuffer(), APPLICATION_JSON.toString());
...
// send back the validated response
validatedResponse.send(httpServerRequest.response());

Vert.x io_uring transport

Vert.x io_uring is a transport using the io_uring interface of the Linux kernel, providing a high I/O performance scalable interface for fully asynchronous Linux syscalls.

Some Vert.x components will leverage this transport:

  • Vert.x Core TCP, HTTP, datagram servers/clients
  • PostgreSQL, MySQL, MSSQL and DB2 reactive clients
  • Vert.x gRPC

You can read the the full list here

SSL

Vert.x now disables TLS 1.0/1.1 and enables TLS 1.3 by default.

You can now update Vert.x HTTP server/client certificates on the fly:

vertx.setPeriodic(REFRESH_PERIOD, id -> {
  SSLOptions options = peekUpdatedConfiguration();
  server.updateSSLOptions(options);
});

Improvements to the GraphQL-Java integration

Vert.x 4.4 ships several improvements to the GraphQL-Java integration with Vert.x Web.

In a follow-up article, we go through the most important of them:

  • GraphiQL IDE upgrade (slick UI and subscriptions support),
  • simplified data fetcher definitions (using instrumentation),
  • support of Apollo’s Automatic Persisted Queries (APQ).

Various improvements

Posted on 2 March 2023
in releases
2 min read

Related posts