• 总结:假如自定义依赖全部存在,则执行生效顺序依次为

    tomcat > jetty > undertow > netty

private static RequestUpgradeStrategy initUpgradeStrategy() {String className;if (tomcatPresent) {className = "TomcatRequestUpgradeStrategy";}else if (jettyPresent) {className = "JettyRequestUpgradeStrategy";}else if (jetty10Present) {className = "Jetty10RequestUpgradeStrategy";}else if (undertowPresent) {className = "UndertowRequestUpgradeStrategy";}else if (reactorNettyPresent) {// As late as possible (Reactor Netty commonly used for WebClient)className = "ReactorNettyRequestUpgradeStrategy";}else {throw new IllegalStateException("No suitable default RequestUpgradeStrategy found");}try {className = "org.springframework.web.reactive.socket.server.upgrade." + className;Class<?> clazz = ClassUtils.forName(className, HandshakeWebSocketService.class.getClassLoader());return (RequestUpgradeStrategy) ReflectionUtils.accessibleConstructor(clazz).newInstance();}catch (Throwable ex) {throw new IllegalStateException("Failed to instantiate RequestUpgradeStrategy: " + className, ex);}}
  1. tomcat (默认)
 <dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId>
</dependency>

  1. 将默认容器替换为 undertow 容器
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- 默认执行顺序:tomcat > jetty > undertow > netty--><!-- 排除tomcat引入其他容器 --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions>
</dependency>
<!-- 替换为 undertow -->
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-undertow</artifactId>
</dependency>

  1. 将默认容器替换为 jetty 容器
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- 默认执行顺序:tomcat > jetty > undertow > netty--><!-- 排除tomcat引入其他容器 --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions></dependency><!-- 替换为 jetty --><dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-jetty</artifactId></dependency>

  1. 将默认容器替换为 netty 容器
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-web</artifactId><exclusions><!-- 默认执行顺序:tomcat > jetty > undertow > netty--><!-- 排除tomcat引入其他容器 --><exclusion><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-tomcat</artifactId></exclusion></exclusions>
</dependency><!-- 替换为 netty -->
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter-reactor-netty</artifactId>
</dependency>

springboot 4大默认容器、指定运行容器相关推荐

  1. 服务器运行容器工具大盘点!

    服务器到底是什么? 服务器的硬件好理解,其实就是一台性能.稳定性.扩展性等等比我们普通个人PC强的一台机器而已,它也需要搭载操作系统,比如有专门的Windows Server或者各种Linux发行版系 ...

  2. Docker 容器默认root账号运行

    默认情况下,容器中的进程以 root 用户权限运行,并且这个 root 用户和宿主机中的 root 是同一个用户.听起来是不是很可怕,因为这就意味着一旦容器中的进程有了适当的机会,它就可以控制宿主机上 ...

  3. 指定docker容器内存_Docker指定容器使用内存

    如果是还没有生成的容器,你可以从指定镜像生成容器时特意加上run -m 256m 或 --memory-swap=512m来限制. -m操作指定的是物理内存,还有虚拟交换分区默认也会生成同样的大小,而 ...

  4. 【翻译】如何在Nutanix Karbon上并排运行容器和虚拟机

    发布日期:2021年10月11日 Nutanix高级系统可靠性工程师Nimal Kunnath的特邀文章 全世界的组织正在以惊人的速度采用Kubernetes和云原生技术.容器已经成为打包应用的新规范 ...

  5. JVM XMX设置多大比较好,Docke容器里该怎么设置JVM呢@无界编程

    XMX是JVM的最大堆内存大小,XMS是JVM的初始堆内存大小. 不管是工作还是面试经常遇到一个问题就是XMX到底设置多大比较好? 网上的答案大多是说XMX和XMS设置为一样大,但是没有说到底XMX设 ...

  6. 【学习笔记】Docker - 02. 在容器中运行软件(上)

    2.1 控制容器: 构建一个网站监视器 需求: 客户想让你做一个网站, 这个网站需要被紧密的监视, 如果服务器宕机了, 那么它们的团队会收到相关的邮件. 这里用到了3个容器. 第一个运行NGINX;  ...

  7. docker 运行容器_Docker之运行 Django 容器

    首先此篇笔记默认你已经安装好了 Docker,并了解 Docker 的基础概念,诸如镜像.容器.以及他们之间的关系等. 如果不太了解,等我回头了解清楚以后,可以再写一篇文章阐述一下.(狗头 当然,对于 ...

  8. Docker 容器的运行(八)

    一.运行容器 1.运行第一个容器 现在,让我们尝试启动第一个 Docker 容器.我们可以使用docker run命令创建容器,docker run命令提供了 Docker 容器的创建到启动的功能. ...

  9. Docker基础学习笔记( 搭建web漏洞检测环境和容器中运行Django项目)

    目录 一.Docker技术的学习 1.1.docker安装(ubuntu16.04) 1.1.1.apt-get换国内清华源 1.1.2.安装最新版本的Docker 1.2.docker容器与镜像使用 ...

最新文章

  1. Python调整图片大小并保存调整后的图像
  2. 知识图谱和图分析与可视化
  3. css3.0动画,CSS3.0实现霓虹灯按钮动画特效的示例代码
  4. python 画风场 scipy_科学网-Python: 扩展库SciPy-刘洋洋的博文
  5. BUUCTF-Reverse:内涵的软件
  6. springmvc跨域问题
  7. leetcode1046. 最后一块石头的重量(堆)
  8. 12 MM配置-主数据-定义物料组
  9. 今天中国获得金牌数量是7块,位居奖牌榜首位
  10. python xml.dom模块解析xml
  11. 静态类型和动态类型的语言有什么区别?
  12. 项目添加程序集的引用后老是报错
  13. adobe黑体std能商用_adobe字体版权?
  14. 【UV打印机】PrintExp打印软件教程(六)-高级模式(马达)
  15. RestTemplate获取HTTP状态码
  16. word生成html冗余清理,如何清除WORD冗余格式代码(转)
  17. Spring笔记(基于狂神视频+自己理解)
  18. 事务码ABAVN-资产卡片报废-BAPI_ASSET_RETIREMENT_POST
  19. 谷歌地球 hosts文件_【教程】DEM+谷歌地球取点工具下载地形矢量数据
  20. 结对作业 微软学术搜索分析

热门文章

  1. 用js刷新当前页面的几种方法,包括reload方法、replace方法、自动刷新方法等。
  2. Win10《芒果TV》更新v3.5.2星玥版:修复电视台直播异常,优化添加下载提示
  3. java服务负载均衡_适用于Java开发人员的微服务:配置,服务发现和负载平衡
  4. 灵动微MM32F103单片机常见问题解答
  5. Android 相机 或者 相册 获取图片裁剪 适用6.0/7.0
  6. 《趣学算法(第2版)》读书笔记 Part 1 :如何高效学习算法
  7. 华为手机怎么设置无线网连接服务器,华为HG520s路由器怎么设置 华为HG520s路由器教程【图文】...
  8. 数仓面试|四个在工作后才知道的SQL密技
  9. 电子电器产品温湿度组合循环测试标准及方法
  10. 圆角教程,教你制作网页常用的圆角矩形边角