quarkus 使用什么应用服务器?

What application server does quarkus use?

启动 quarkus jar 时,我没有看到任何服务器启动,我看到的是:

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]

这是什么意思?它没有使用应用程序服务器吗? Quarkus 是应用服务器还是类似的东西? 我似乎无法在网上找到有关此的任何信息。

正如 homepage 所说:

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

这还没有真正说明 quarkus 是否(除其他外)应用程序服务器。我知道 it uses undertow. A post on the thorntail community wiki 暗示 quarkus 是 thorntail 的精神继承者,因此实际上是一个嵌入式应用程序服务器。

它是一个微服务框架,而不是应用服务器。 您不能 'deploy' Quarkus 服务器上的多个应用程序,Quarkus 只是启动 TCP 套接字以服务一个应用程序的启动序列的一部分。

过去的应用程序服务器旨在 deploy/start/stop 具有单个 JVM 运行时的单台机器上的多个应用程序,而无需停止 JVM。 Quarkus 和其他微服务框架针对 Docker 运行时,不再真正关心为多个应用程序启动和停止多个 JVM。他们也不关心 JVM 需要为应用程序升级而停止和启动,旧的应用程序服务器试图避免这种情况。

, I don't see any server starting up,

我在您的日志中看到 NettyRecorder,它正在侦听端口 8080。这实际上是在启动 "the server"

https://code.quarkus.io/ 你可以看到它可以将 Undertow 用于 servlet,或将 Vertx 用作嵌入式服务器,将 RESTEasy / JAX-RS 作为 REST API 库实现

Camel 的 HTTP 端点是另一个可能的服务器

Quarkus 使用 Vert.x/Netty.

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

它使用了 vertx,这是一个响应式工具包。