Thorntail

Thorntail, previously called WildFly Swarm, is an open source implementation of MicroProfile specifications. It's built on top of mature technologies, and it leverages existing expertise that has been derived from Jakarta EE specifications, patterns, and implementations.

The Thorntail project was born with WildFly/Jakarta EE, but it focuses on modern cloud applications, following the path made by MicroProfile.io (in certain ways). It initially implemented version 1.3 of MicroProfile. You can find its specifications at https://github.com/eclipse/microprofile-bom/releases/download/1.3/microprofile-spec-1.3.pdf.

At the time of writing, Thorntail is in version 2.0.0, and it includes all of the features implemented in WildFly Swarm 2018.5.0.

You can consider Thorntail as a combination of all the benefits of the mature Java EE/Jakarta EE specifications and the flexibility of the MicroProfile.io and cloud-oriented concepts, as illustrated by the following diagram:

Indeed, when you build a traditional Jakarta EE application (distributed using the standard EAR or WAR), you need to install the entire application server (for example, WildFly), and then deploy your application on top of it.

It is true that with the introduction of the web profile (starting with Java EE 6), it is possible to decrease the number of APIs and components present in the initial configuration of the application server.

Further optimizations have been made by the application servers to only load the specifications (and consequently, the classes) that our application really needs. WildFly, for example, has four basic configuration profiles, which make up only a subset of the functionalities available during the start of the application server. WildFly also loads its subsystems in a lazy way, so that its footprint is very low, and the memory usage related to loaded classes is strictly related to what the application really uses.

However, in microservice architectures, this is not enough, because with a traditional Jakarta EE application server, you could have significantly more functionality than your application requires.

Thorntail gives you the ability to create a final package that contains exactly what you need for your deployment, using two different strategies, as follows:

  • Uber JAR: A self-contained, executable Java archive that contains your application, the fractions of Thorntail required to support it, a Maven repository of dependencies, and a small library that's needed to bootstrap it all.
  • Hollow Uber JAR: A self-contained, executable Java archive that contains no application code, but only what you need to run it. Usually, it contains a subset of APIs, Jakarta EE, and MicroProfile, that your application will use. In this way, you exclude your EAR or WAR file (with the application code) from the executable Hollow JAR. Then, you can deploy your application artifact in the same style as traditional Jakarta EE app servers.

One of the key elements of Thorntail is the fraction, which will be explained in the following section.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset