Meet Quarkus

January 11, 2022

More or less every Java developer has at least heard about the Spring framework. It has been around for quite some time without any serious competition. With the popularization of containers, Kubernetes, and cloud computing, some new tools were created. One that I am particularly interested in is called Quarkus. It is an open-source project, developed by Red Hat. Its goal is to provide an effective platform for cloud, Kubernetes, and serverless environments.

In this article, I am going to describe how to create a very basic Quarkus web application and point out some features which could convince you to try it out yourself.

The simplest way to get started is by visiting the code.quarkus.io web page to bootstrap the project. The 2 extensions that we are going to use are:


After the project is initialized, you should end up with 2 generated Java classes, one as a rest endpoint and another one rendering an HTML page.

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

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String hello() {
        return "Hello RESTEasy";
    }
}
            @Path("/some-page")
public class SomePage {

    private final Template page;

    public SomePage(Template page) {
        this.page = requireNonNull(page, "page is required");
    }

    @GET
    @Produces(MediaType.TEXT_HTML)
    public TemplateInstance get(@QueryParam("name") String name) {
        return page.data("name", name);
    }
}

The Qute template is placed in the "resources/templates" folder and named the same as the Template field of the class SomePage.

You can start the application in dev mode with the following Gradle task:

./gradlew quarkusDev

Out of the box, the application is accessible on port 8080 and because we launched it in dev mode, some handy features are available to us:


The 3 mentioned features are the ones I find especially useful as they boost development productivity a lot. You may question the hot reload times for a productive application with additional extensions. In my experience it will for sure take longer, but it is still way better as rebuilding and starting the application yourself. For those willing to see some numbers, I have experienced times between 3 and 8 seconds, including extensions like ORM, metrics, GRPC, REST client, and more. Of course, there are a lot of factors to the equation.

Although we didn't write any code ourselves, you can get a feeling of how a very simple Quarkus application, supporting rest endpoints and HTML pages, could be implemented. There is a lot more to cover, but the current state should be enough for you to decide if you are willing to put more time into Quarkus. I am planning to cover more details as standalone posts in the future, so stay tuned.

Check out the GitHub project for full implementation.