Question: 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?

Answer: 
Use this code.

```
SpringApplication application = new SpringApplication(DemoApplication.class);
application.setWebApplicationType(WebApplicationType.NONE);
application.run(args);

```
In Spring boot, Spring Web dependency provides an embedded Apache Tomcat web server. If you remove **spring-boot-starter-web** dependency in the pom.xml then it doesn't provide an embedded web server.

remove the following dependency

```
<dependency>
   <groupId>org.springframework.boot</groupId>
   <artifactId>spring-boot-starter-web</artifactId>
</dependency>

```