12

When starting a quarkus jar, I don't see any server starting up, all I see is:

C:\Java Projects\quarkus-demo\target>java -jar quarkus-demo-1.0-SNAPSHOT-runner.jar
2020-01-04 18:25:54,199 WARN  [io.qua.net.run.NettyRecorder] (Thread-1) Localhost lookup took more than one second, you ne
ed to add a /etc/hosts entry to improve Quarkus startup time. See https://thoeni.io/post/macos-sierra-java/ for details.
2020-01-04 18:25:54,521 INFO  [io.quarkus] (main) quarkus-demo 1.0-SNAPSHOT (running on Quarkus 1.1.0.Final) started in 3.
231s. Listening on: http://0.0.0.0:8080
2020-01-04 18:25:54,522 INFO  [io.quarkus] (main) Profile prod activated.
2020-01-04 18:25:54,522 INFO  [io.quarkus] (main) Installed features: [cdi, resteasy, resteasy-jackson]

What does that mean? Is it not using an application server? Is Quarkus an application server or something similar? I can't seem to find any information online about this.

D.Tomov
  • 1,018
  • 2
  • 15
  • 36

5 Answers5

22

Quarkus uses Vert.x/Netty.

From https://developers.redhat.com/blog/2019/11/18/how-quarkus-brings-imperative-and-reactive-programming-together/:

Quarkus uses Vert.x and Netty at its core. And, it uses a bunch of reactive frameworks and extensions on top to help developers. Quarkus is not just for HTTP microservices, but also for event-driven architecture. Its reactive nature makes it very efficient when dealing with messages (e.g., Apache Kafka or AMQP).

The secret behind this is to use a single reactive engine for both imperative and reactive code.

Quarkus does this quite brilliantly. Between imperative and reactive, the obvious choice is to have a reactive core. What that helps with is a fast non-blocking code that handles almost everything going via the event-loop thread (IO thread). But, if you were creating a typical REST application or a client-side application, Quarkus also gives you the imperative programming model. For example, Quarkus HTTP support is based on a non-blocking and reactive engine (Eclipse Vert.x and Netty). All the HTTP requests your application receive are handled by event loops (IO Thread) and then are routed towards the code that manages the request. Depending on the destination, it can invoke the code managing the request on a worker thread (servlet, Jax-RS) or use the IO was thread (reactive route).

Loris Securo
  • 7,538
  • 2
  • 17
  • 28
10

It's a microservice framework, not an application server. You can't 'deploy' multiple applications on a Quarkus server, Quarkus is just part of the startup sequence that starts a TCP Socket to serve one application.

Application servers in the past were meant to deploy/start/stop multiple applications on a single machine with a single JVM runtime without stopping the JVM. Quarkus and other microservice framework are targeted to Docker runtimes, and don't really care anymore about starting and stopping multiple JVM's for multiple applications. They also don't care that the JVM needs to be stopped and started for an application upgrade, where older application servers tried to avoid that.

GeertPt
  • 16,398
  • 2
  • 37
  • 61
1

As the homepage says:

A Kubernetes Native Java stack tailored for OpenJDK HotSpot and GraalVM, crafted from the best of breed Java libraries and standards.

This does not yet really provide as to if quarkus is (amongst other things) an application server. I know that it uses undertow. A post on the thorntail community wiki suggests that quarkus is the spirital successor of thorntail and thus, in fact, an embedded application server.

Turing85
  • 18,217
  • 7
  • 33
  • 58
1

, I don't see any server starting up,

I see NettyRecorder in your logs, and it's listening on port 8080. That's effectively starting "the server"

From https://code.quarkus.io/ you can see it can use Undertow for servlets, or Vertx as an embedded server, with RESTEasy / JAX-RS as the REST API library implementations

Camel's HTTP endpoint is another possible server

OneCricketeer
  • 179,855
  • 19
  • 132
  • 245
  • I see here it says it uses netty as a foundation layer and that netty is a nonblocking. https://quarkus.io/extensions/ . Does that mean if I need just a simple rest servlet server I have to switch it some how? – D.Tomov Jan 04 '20 at 17:00
  • 2
    Netty handles the TCP layer. Vertx or Undertow handle the HTTP traffic. Not sure that answers your question – OneCricketeer Jan 04 '20 at 17:04
0

It uses vertx, that is a reactive toolkit.

Swe77
  • 21
  • 4