Eclipse Vert.x 4.5.8 released!

We are extremely pleased to announce that Eclipse Vert.x version 4.5.8 has been released.

Since the release of Vert.x 4.5.7, quite a few bugs have been reported. We would like to thank you all for reporting these issues.

In addition, a couple of important items are noteworthy

Future expectation + HTTP response expectations

You can use a new feature for HTTP/Web client that facilitate HTTP interactions, this new feature supersedes the Web client response predicates API with a new expectation based API that provides the same features for both HTTP and Web clients.

client
  .get(8080, "myserver.mycompany.com", "/some-uri")
  .send()
  .expecting(HttpResponseExpectation.SC_OK.and(HttpResponseExpectation.JSON))
  .onSuccess(res -> {
    // ....
  });

This feature is actually built on top of a the new Future#expecting operator that synchronously check the response of a predicate like operator called Expectation

Future.succeededFuture("hello")
   .expecting(res -> true)
   .onSuccess(s -> System.out.printl("Expectation met"));
 
Future.succeededFuture("hello")
   .expecting(res -> false)
   .onFailure(s -> System.out.printl("Expectation not met"));

Expectation are pretty much like a predicate, yet they provide a meaningful error message the expectation is not met.

It has multiple usage like the new HttpResponseExpectation that provides reusable expectations for both HTTP and Web client, it can also facilitate testing, e.g. we have defined this expectation in vertx-core tests

public static <T> Expectation<T> that(Consumer<? super T> consumer) {
  return value -> {
    consumer.accept(value);
    return true;
  };
}
 
@Test
public void someTest() {
  Future<Result> fut = getSomeFuture()
     .expecting(that(res -> assertNotNull(res)));
}

Default Hazelcast version

The Hazelcast dependency is changed to 5.3 since Hazelcast 4 is not anymore supported and 4.2.8 has known vulnerabilities (CVE-2023-45860, CVE-2023-45859, CVE-2023-33265, CVE-2023-33264).

This cluster manager remains tested with Hazelcast 4.2.8 and 5.3, so 4.2.8 remains supported, the Hazelcast version must be explicitly set to 4.2.8 if needed until an upgrade can be achieved.

The 4.5.8 release notes as well as deprecations and breaking changes can be found on the wiki.

You can bootstrap a Vert.x 4 project using start.vertx.io.

The release artifacts have been deployed to Maven Central and you can get the distribution on Maven Central.

The Vert.x 4 eventbus JavaScript client library is now available in a single location and it now usable standalone or it can easily be integrated with any frontend build tool.

The Vert.x distribution is available from SDKMan and our HomeBrew TAP.

Docker images are available on Docker Hub.

That’s it! Happy coding and see you soon on our user or dev channels.

Posted on 24 May 2024
in releases
2 min read

Related posts