gpt4 book ai didi

java - quarkus 使用什么应用服务器?

转载 作者:行者123 更新时间:2023-12-03 18:30:39 24 4
gpt4 key购买 nike

启动 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 是应用服务器还是类似的东西?
我似乎无法在网上找到有关此的任何信息。

最佳答案

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

关于java - quarkus 使用什么应用服务器?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/59592676/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com