Preview of a guide for Java developers

I could not at­tend the last Eclipse Vert.x com­mu­nity face-​to-face meet­ing last fall, but one item that was dis­cussed is the need for guides aimed at cer­tain types of de­vel­op­ers. One of my mis­sions as part of join­ing the team was to work on this and I’m very happy to share it with you today!

A gentle guide to asynchronous programming with Eclipse Vert.x for enterprise application developers

The guide is called “A gen­tle guide to asyn­chro­nous pro­gram­ming with Eclipse Vert.x for en­ter­prise ap­pli­ca­tion de­vel­op­ers” and it is an in­tro­duc­tion to asyn­chro­nous pro­gram­ming with Vert.x, pri­mar­ily aimed at de­vel­op­ers fa­mil­iar with main­stream non-​asynchronous web de­vel­op­ment frame­works and li­braries (e.g., Java EE, Spring).

Quot­ing the in­tro­duc­tion:

We will start from a wiki web ap­pli­ca­tion backed by a re­la­tional data­base and server-​side ren­der­ing of pages; then we will evolve the ap­pli­ca­tion through sev­eral steps until it be­comes a mod­ern single-​page ap­pli­ca­tion with “real-​time” web fea­tures. Along the way you will learn to:

  1. De­sign a web ap­pli­ca­tion with server-​side ren­der­ing of pages through tem­plates, and using a re­la­tional data­base for per­sist­ing data.
  2. Cleanly iso­late each tech­ni­cal com­po­nent as a reusable event pro­cess­ing unit called a ver­ti­cle.
  3. Ex­tract Vert.x ser­vices for fa­cil­i­tat­ing the de­sign of ver­ti­cles that com­mu­ni­cate with each other seam­lessly both within the same JVM process or among dis­trib­uted nodes in a clus­ter.
  4. Test­ing code with asyn­chro­nous op­er­a­tions.
  5. In­te­grat­ing with third-​party ser­vices ex­pos­ing a HTTP/JSON web API.
  6. Ex­pos­ing a HTTP/JSON web API.
  7. Se­cur­ing and con­trol­ling ac­cess using HTTPS, user au­then­ti­ca­tion for web browser ses­sions and JWT to­kens for third-​party client ap­pli­ca­tions.
  8. Refac­tor­ing some code to use re­ac­tive pro­gram­ming with the pop­u­lar Rx­Java li­brary and its Vert.x in­te­gra­tion.
  9. Client-​side pro­gram­ming of a single-​page ap­pli­ca­tion with An­gu­larJS.
  10. Real-​time web pro­gram­ming using the uni­fied Vert.x event bus in­te­gra­tion over SockJS.

The guide takes a grad­ual ap­proach by start­ing with a “quick and dirty” so­lu­tion, then refac­tor­ing it prop­erly, ex­pos­ing the core Vert.x con­cepts, adding fea­tures, and mov­ing from call­backs to Rx­Java.

We need your feedback!

The code is avail­able at https://github.com/vert-​x3/vertx-​guide-for-java-devs. You can re­port feed­back as Github is­sues to that repos­i­tory and even offer pull-​requests.

You can check it out from GitHub (the Asci­iDoc is being ren­dered fine from the repos­i­tory in­ter­face) or you can check out pre-​rendered HTML and PDF ver­sions that I am tem­porar­ily shar­ing and keep­ing up-​to-date from my Drop­box: https://www.drop­box.com/sh/ni9zn­fk­zlkl3q12/AABn-​OCi1CZfg­bT­zOU0jYQpJa?dl=0

Many thanks to Thomas Segis­mont and Julien Viet who con­tributed some parts, and also to the peo­ple who re­viewed it pri­vately.

As usual, we wel­come your feed­back!

Next post

OpenAPI (fka Swagger) 3 support in Eclipse Vert.x now in test stage!

As GSoC 2017's student, I'm working on an embedded support to OpenAPI 3 standard inside Eclipse Vert.x framework. Now, after a lot of work, you can try it!

Read more
Previous post

Presentation of the Vert.x-Swagger project

This post is an introduction to the Vert.x-Swagger project, and describe how to use the Swagger-Codegen plugin and the SwaggerRouter class.

Read more
Related posts

Things to keep in mind concerning CSRF attacks

Eclipse Vert.x like most frameworks provides an anti-CSRF defense. However, no framework can prevent all attack vectors that exist in the web. Therefore, developers need to be aware of some dangers and common attack vectors concerning CSRF defenses.

Read more

Unit and Integration Tests

Let’s refresh our mind about what we developed so far in the introduction to vert.x series. We forgot an important task. We didn’t test the API.

Read more

Some Rest with Vert.x

This post is part of the Introduction to Vert.x series. Let’s go a bit further this time and develop a CRUD-ish application

Read more