没有 Web 服务器的 Spring Boot [英] Spring Boot without the web server

查看:62
本文介绍了没有 Web 服务器的 Spring Boot的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个简单的 Spring Boot 应用程序,它从 JMS 队列获取消息并将一些数据保存到日志文件中,但不需要 Web 服务器.有没有办法在没有 Web 服务器的情况下启动 Spring Boot?

I have a simple Spring Boot application that gets messages from a JMS queue and saves some data to a log file, but does not need a web server. Is there any way of starting Spring Boot without the web server?

推荐答案

如果类路径上没有 Tomcat 依赖项,Spring Boot 将不包含嵌入式 tomcat.你可以在 EmbeddedServletContainerAutoConfiguration 类中自己查看这个事实,你可以找到它的来源 此处.

Spring boot will not include embedded tomcat if you don't have Tomcat dependencies on the classpath. You can view this fact yourself at the class EmbeddedServletContainerAutoConfiguration whose source you can find here.

代码的核心是在EmbeddedTomcat

此外,有关更多信息,请查看thisthis 指南和 文档的这一部分

Also, for more information check out this and this guide and this part of the documentation

这篇关于没有 Web 服务器的 Spring Boot的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆