Eclipse Vert.x 3.7.1

We have just re­leased Vert.x 3.7.1, a bug fix re­lease of Vert.x 3.7.x and a few small fea­tures.

Since the re­lease of Vert.x 3.7.0, quite a few bugs have been re­ported. We would like to thank you all for re­port­ing these is­sues.

In ad­di­tion of bug fixes, this re­lease pre­pares the ground for Vert.x 4 with a few en­hance­ments and dep­re­ca­tions.

HTTP client Unix Domain Sockets

Since this re­lease the HttpClient sup­ports Unix Do­main Sock­ets when using Netty’s na­tive trans­ports, which can be re­ally use­ful if you need to con­nect to a local dae­mon such as Docker’s Dae­mon:

HttpClient httpClient = vertx.createHttpClient();

// Only available on BSD and Linux with native transport
SocketAddress addr = SocketAddress.domainSocketAddress("/var/tmp/myservice.sock");

// Send request to the server
httpClient.request(HttpMethod.GET, addr, 8080, "localhost", "/", resp -> {
  // Process response
}).end();

HTTP client WebSocket connect revisited

The HttpClient Web­Socket meth­ods have been re­vis­ited, in­deed these meth­ods were lack­ing of us­abil­ity in gen­eral or with vertx-​rx due to the op­tional error han­dling:

HttpClient client = vertx.createHttpClient();
client.websocket(80, "example.com", "/", websocket -> {
  // connected
});

// or

client.websocket(80, "example.com", "/", websocket -> {
  // connected
}, err -> {
  // handle error
});

The new webSocket method pro­vides now the best de­vel­oper ex­pe­ri­ence for con­nect­ing a Web­Socket:

HttpClient client = vertx.createHttpClient();
client.webSocket(80, "example.com", "/", ar -> {
  if (ar.succeeded()) {
    // connected
  } else {
    // handler error
  }
});

With Rx­Java2, you can use now:

HttpClient client = vertx.createHttpClient();
Single<WebSocket> single = client.rxWebSocket(80, "example.com", "/");
single.subscribe(
  ws -> {
    // connected
  },
  err -> {
    // handle error
  });

Vert.x Rx usability improvements

As you may know, the Vert.x Rx­i­fied API is gen­er­ated from the bare Vert.x API.

In this re­lease, vertx-codegen has been im­proved to de­ter­mine if an API ob­ject is an Iterable, Iterator, or Function. Then its Rx­i­fied equiv­a­lent will be an Iterable, Iterator, or Function too.

Let’s take an ex­am­ple. The Vert.x MultiMap class rep­re­sents a multi-​map of String keys to a list of String val­ues. It’s use­ful to rep­re­sent things like HTTP head­ers and pa­ra­me­ters which allow mul­ti­ple val­ues for keys.

Since the bare io.vertx.core.MultiMap im­ple­ments Iterable<Map.Entry<String, String>>, you can it­er­ate through the con­tent with a for-each loop. Start­ing with 3.7.1, the same is pos­si­ble with the Rx­i­fied ver­sion:

io.vertx.reactivex.core.MultiMap headers = request.headers();
for (Entry<String, String> header : headers) {
  // inspect header  
}

Or, for ad­vanced trans­for­ma­tions:

Flowable<Entry<String, String>> headers = Flowable.fromIterable(request.headers());

GraphiQL IDE

Vert.x 3.7.0 added sup­port for build­ing GraphQL servers with Vert.x Web and GraphQL-​Java.

In 3.7.1, the GraphQL han­dler can be con­fig­ured to ex­pose the GraphiQL IDE:

GraphQLHandlerOptions options = new GraphQLHandlerOptions()
  .setGraphiQLOptions(new GraphiQLOptions()
    .setEnabled(true)
  );

router.route("/graphql").handler(GraphQLHandler.create(graphQL, options));

Vert.x 3.8.0 is the next release

The next ver­sion of Vert.x will be 3.8 and tar­gets end of June / early July with the fol­low­ing themes:

  • In­tro­duc­ing a Promise in­ter­face to be used in­stead of Fu­ture in a cou­ple of places of the code­base such as Verticle start or executeBlocking. The goal is to move the com­ple­tion part in Vert.x 4 from Future to Promise which be­comes the ob­ject to be com­pleted and Future is a view that is con­sumed by clients
  • Json Pointer sup­port
  • The new SQL client will be re­leased as tech pre­view (until v4)
  • Re­dis­Pool as tech pre­view (until v4) bring back con­nec­tion man­age­ment, lazy re­con­nect and scal­ing to all client modes (Sin­gle, Sen­tinel and Clus­ter)

Vert.x 3.7.1 re­lease notes

Vert.x 3.7.1 dep­re­ca­tions and break­ing changes

https://github.com/vert-​x3/wiki/wiki/3.7.1-​Deprecations-and-breaking-changes

The event bus client using the SockJS bridge are avail­able from NPM, Bower and as a We­b­Jar:

Docker im­ages are also avail­able on the Docker Hub. The Vert.x dis­tri­b­u­tion is also avail­able from SD­KMan and Home­Brew.

The ar­ti­facts have been de­ployed to Maven Cen­tral and you can get the dis­tri­b­u­tion on Bin­tray.

Happy cod­ing and see you soon on our user or dev chan­nels.

Next post

VS Code Vert.x Starter Extension

Today, we are really excited to announce the Visual Studio Code Vert.x Starter extension. It allows you to create a Vert.x project, customize the creation, and search for dependencies.

Read more
Previous post

Eclipse Vert.x 3.7.0 released!

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

Read more
Related posts

Building services and APIs with AMQP 1.0

Microservices and APIs are everywhere. Everyone talks about them, presentation slides are full of them ... some people are actually even building them.

Read more

Eclipse Vert.x 3.7.0 released!

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

Read more

Real-time bidding with Websockets and Vert.x

The expectations of users for interactivity with web applications have changed over the past few years. Users during bidding in auction no longer want to press the refresh button.

Read more