Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What application server does quarkus use?

Tags:

java

quarkus

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.

like image 308
D.Tomov Avatar asked Jan 04 '20 16:01

D.Tomov


People also ask

What is the use of Quarkus API?

This API is mostly useful in situations where CDI injection is not available. Quarkus itself is configured via the same mechanism as your application. Quarkus reserves the quarkus. namespace for its own configuration. For example to configure the HTTP server port you can set quarkus.http.port in application.properties.

How do I configure Quarkus in Java?

Configuring Quarkus. Quarkus itself is configured via the same mechanism as your application. Quarkus reserves the quarkus. namespace for its own configuration. For example to configure the HTTP server port you can set quarkus.http.port in application.properties.

What is Quarkus framework?

Quarkus is a framework developed by RedHat for creating Java applications. Quarkus was developed with the goal of running Java programs in containers. In particular, it focuses on supporting orchestration software Kubernetes. Another focus of Quarkus development is on the use of established Java libraries and standards.

Is Quarkus the best framework for Java migration?

The advantages of Quarkus are obvious. However, the framework also has some limitations. As such, Quarkus is not primarily intended to migrate existing Java applications. Instead, it is worth using Quarkus as a starting point for new development. We will look at a few specific areas of application below.


2 Answers

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).

like image 78
Loris Securo Avatar answered Oct 15 '22 04:10

Loris Securo


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.

like image 32
GeertPt Avatar answered Oct 15 '22 04:10

GeertPt