Spring Boot without the web server

后端 未结 16 799
眼角桃花
眼角桃花 2020-11-29 16:50

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 S

16条回答
  •  眼角桃花
    2020-11-29 17:04

    Spring boot has many starters, some starters have an embedded web server, some don't. The following have the embedded web server:

    spring-boot-starter-web
    spring-boot-starter-data-jpa
    spring-boot-starter-jetty
    spring-boot-starter-tomcat
    spring-boot-starter-jdbc
    spring-boot-starter-data-rest
    ...
    

    Pick the one that meets your requirements and that does not have server support.

    I only need to make restful json api request in my spring application, so the starter I need is

    spring-boot-starter-json
    

    which provide RestTemplate and jackson for me to use.

提交回复
热议问题