嵌入式响应式Web服务器和Spring Boot中的嵌入式Web服务器之间有什么区别?

huangapple go评论47阅读模式
英文:

What is the difference between embedded reactive web server and embedded web server in spring boot

问题

以下是翻译好的部分:

在我的项目中,我们正在使用Google Kubernetes Engine(GKE)和Spring Webflux,哪个更好?

Spring Webflux中的WebApplicationType.REACTIVE有什么优缺点?

何时使用嵌入式REACTIVE Web服务器和嵌入式Web服务器?

英文:
new SpringApplicationBuilder(Application.class)
  .web(WebApplicationType.REACTIVE).run(args)

In my project we are using google kubernetes engine (gke) and spring webflux for this which one is better.

What are the pros and cons of WebApplicationType.REACTIVE in Spring Webflux?

When to use embedded REACTIVE Webserver and embedded Webserver?

答案1

得分: 1

在Spring中,有三种可能的Web应用程序类型:

NONE - 应用程序不应作为Web应用程序运行,也不应启动嵌入式Web服务器。

SERVLET - 应用程序应作为基于Servlet的Web应用程序运行,并应启动嵌入式Servlet Web服务器。

REACTIVE - 应用程序应作为反应式Web应用程序运行,并应启动嵌入式反应式Web服务器。

如果您使用Spring WebFlux,应选择REACTIVE。反应式Web服务器基于Reactor Netty框架构建,它是一种非阻塞的事件驱动服务器。

如果您使用Spring MVC,应选择SERVLET

英文:

There are three possible types of web applications in spring:

NONE - The application should not run as a web application and should not start an embedded web server

SERVLET - The application should run as a servlet-based web application and should start an embedded servlet web server.

REACTIVE - The application should run as a reactive web application and should start an embedded reactive web server.

If you use Spring WebFlux you should choose REACTIVE. The reactive web server is based on the Reactor Netty framework, which is a non-blocking, event-driven server.

If you use Spring MVC you should choose SERVLET.

huangapple
  • 本文由 发表于 2023年5月24日 18:41:21
  • 转载请务必保留本文链接:https://go.coder-hub.com/76322635.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定