Introduction to Quarkus - Supersonic Subatomic Java
11.11.2019, Michael Gerber

nxt had the pleasure to give an introduction to the Cloud Native Java Framework Quarkus at the ETH Zurich. Quarkus convinces with a very fast start-up time and a small memory footprint.

Quarkus

Quarkus is a cloud-native Java software development stack, built around the GraalVM and OpenJDK HotSpot. It’s based on some of the best Java libraries and standards there are. The Quarkus project is opensource and driven mainly by Red Hat. Leveraging the GraalVM, a Quarkus-based Java application can be compiled to a native application for Linux, macOS and Windows. Being a native application has the benefits of a greatly reduced memory footprint (like five times less) and a much improved performance when starting up (up to 50 times faster).

On November 6th 2019 the first release candidate of version 1.0 was presented. So we can expect version 1.0 of Quarkus in the coming days.

Presentation

The most important features of Quarkus were shown in the form of a live coding session. One of the best Quarkus extensions is Hibernate Panache. It’s an extension of Hibernate that provides helper methods on the entities to persist or delete them. Furthermore, static helper methods offer possibilities to query entities (see code example).

package nxt;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.QueryParam;
import javax.ws.rs.core.MediaType;

@Path("/hello")
public class ExampleResource {

    @GET
    @Produces(MediaType.APPLICATION_JSON)
    public Hello hello(@QueryParam("language") String language) {
        return Hello.find("language", language).singleResult();
    }

}

The slides of the presentation are available online. If you are interested in a personal introduction to Quarkus, contact us.