Finally, my first steps on Quarkus 🚀, as an Spring-boot developper
Tags: beginners, java, quarkus, keepitsimple
Published: 2022-07-22 04:47:35

Hi everyone 🙋🏻‍♂️,

## We just started trying Quarkus :pray:

[api-transitaires](https://github.com/opt-nc/api-transitaires) was the first, it's time to do some quick feedback now 📢

:point_right: First, I know that it's already a 3 years old framework _(some `npm` libs don't live that long)_, but in some `J`Companies the investissement to set up some Spring[-Boot] 🍃 developers has been challenging, so the replacement has to be valuable (or [_fin valab_](https://www.bdlp.org/fiche/15010?modal=1))

### Why to move from Spring-Boot ?

We have a lot of Sping-Boot apps and we are going forward to k8s in _serverless_ way, so [we did some tests with Spring-Native](https://dev.to/optnc/knative-the-easy-way-to-serverless-a-java-app-3n36).

It worked :+1:, but not so smoothly because of Spring's long history :factory: which led us to more recent alternatives like :point_right: Quarkus.

### Why this app ?

[api-transitaires](https://github.com/opt-nc/api-transitaires) it's a very basic one-endpoint REST API that serves the list of freight forwarders that manage customs clearance on New-Caledonia 🇫🇷.

The main goal was to try Quarkus in a end to end way, in [our GitHub CI](https://dev.to/optnc/this-is-how-we-maintain-release-secured-software-on-github-2pn3) : native app, Docker..

Ok, let's go now..

## 1# IDE integration 📝 - VSCode plugin

I used since almost 2 years VScode, I was happy to discover a [Quarkus's plugin](https://marketplace.visualstudio.com/items?itemName=redhat.vscode-quarkus) who does the job  : 

- generate new project : like SprinBoot does 😉
- launch and debug : ok, relies to `mvn` but it works most of the time 🙄.. sometimes it switched off without saying goodbye _(ex: after adding a Quarkus's extension). Otherwise, I don't like that they preferred to use a specific menu for that rather than VSCode's classic "run and debug" :unamused:

⭐️ What I appreciate :
 - faster code change / test cycle out-of-the box 📦 : do the change, switch to browser and the change is already applied (I experienced a _refresh the browser twice_ cycle with Spring-boot Devtools)

☝️ Nice to have :
- autocompletion on `application.properties` as [Spring-Boot's plugin](https://marketplace.visualstudio.com/items?itemName=Pivotal.vscode-boot-dev-pack) does

## 2# Coding a Rest API 👨🏻‍💻 - the standard way

While Spring has chosen to make its own annotations _(almost a copy of the standard)_, with Quarkus we go back to the Java standard's ones. Ok, [JSR's](https://jcp.org/aboutJava/communityprocess/final/jsr311/index.html) are not so fancy 🌈, but less intrusive 🐙.

## 3# Docs 📖 - self sufficient :+1:

No need to rely [on other documentations](https://www.baeldung.com/spring-boot) to do basic things, [Quarkus's guides](https://quarkus.io/guides/) are in my opinion succinct, practical (_getting started_ style) and well referenced from google 🤓.. 1st result is the official one ! 

Game changing after years of [Spring's _empty shell_ getting started guides](https://spring.io/guides/gs/actuator-service/) or [JavaDoc style reference documentation](https://docs.spring.io/spring-kafka/docs/current/reference/html/#connecting) 😵‍💫

:point_right: I used : 
 - [Rest](https://quarkus.io/guides/rest-json)
 - [Test](https://quarkus.io/guides/getting-started-testing)
 - [Native](https://quarkus.io/guides/building-native-image)

## 4# Fast 🏃💨 - minimum included

- Lighter & faster, some fresh metrics from a recent migration from Spring-Boot ([colisnc-api](https://github.com/opt-nc/colisnc-api)) :
  - _startup time_: from `1s8` to `0.5s` _(is native really needed with Quarkus ? 🤔)_
  - _CI native build_ : from [`14min`](https://github.com/opt-nc/colisnc-api/actions/runs/2692500500) to [`5min`](https://github.com/opt-nc/colisnc-api/actions/runs/2696232492)
  - _Docker Native image size_ : from `40Mo` to `30Mo`

- Minimum included : it's a philosophy and I like it ❤️ _(even the `yaml` configuration is not included : [an extension is needed](https://quarkus.io/guides/config-yaml))_

## 5# Native ⚡️ - the way is paved 🛣

- It seems that it's was on the Quarkus cookbook since the beginning, not added at the end : Spring Native is still in experimentation.
- Light by default : some basic things are not provided by default like SSL protocol support, but it's easy to do [`quarkus.ssl.native=true`](https://quarkus.io/guides/native-and-ssl)

## 6# Monitoring / dev tooling - Side dishes 🥗

- less than actuator, but enough in my mind : [health](https://quarkus.io/guides/smallrye-health), [Swagger](https://quarkus.io/guides/openapi-swaggerui)
- Nice to have [online web dev](https://quarkus.io/guides/dev-ui) that gives some basic but useful metrics _(as others do since a while, like Symfony 😉)_

### Resources

- [api-transitaires](https://github.com/opt-nc/api-transitaires) : first app
- [colisnc-api](https://github.com/opt-nc/colisnc-api) : first [migration from Springboot done within 1h30](https://github.com/opt-nc/colisnc-api/pull/99/files) ⏱

{% embed https://dev.to/optnc/jfokus2022-quarkus-back-from-the-future-445l %}

Cheers 🍻