Spring Boot with Embedded Tomcat Pros and Cons. When you build your web service using Spring Boot, the default setup is to generate a .jar file. The .jar - The web servers can be Tomcat, Jetty, or Undertow . I’m going to focus on Tomcat.
If you work with web services in Java, chances are you work with Spring Boot as well or at least is considering it.
When you build your web service using Spring Boot the default setup is to generate a .jar file. The .jar comes with a web server embedded, and you just need to execute it to have the application up and running. The web servers can be Tomcat, Jetty, or Undertow . I’m going to focus on Tomcat.
It’s also possible to use Spring Boot and deploy as a .war file. That’s how I’m more accustomed to it. It feels more natural to me. It’s how I learned — one single Tomcat installation in the server, with multiple applications deployed as .war files.
In this article, I’m going to address the pros and cons of building a Spring Boot application with an embedded Tomcat. It’s the best way (in my view) if you are working with Microservices.
The pros are not an extensive list, but they are quite significant.
For me, this is the driving force. Isolation means that the applications are not dependent on a single Tomcat installation. If the embedded Tomcat in service A fails, it won’t impact service B or C as each one has its own Tomcat. Unless the services call each other (which it shouldn’t )— but that’s a different problem. With one single Tomcat, with services calling each other or not, if the Tomcat is shut down, all services are impacted.
Such isolation also means that using Docker may be overkill (don’t beat me just yet). I’ve never used Docker, to be honest, I don’t feel comfortable elaborating too much on this argument. I’m pretty sure it provides many benefits. Based on what I’ve read, it involves much more than just building an application with embedded Tomcat.
Learn how to use Spring Boot and JHipster With Reactive Java Microservices. Create a reactive microservices architecture with Spring Boot, Spring Cloud Gateway, Spring Cloud Config, Spring WebFlux, Java, and JHipster.
In the Java world, Spring provides several tools and frameworks to develop microservices, like Spring Boot and Spring Cloud, and in this article, I’ll share a few good courses you can use to learn how to develop microservices using the Spring framework.
These are best online courses to learn Spring Boot, Advanced Java, Docker, React, Microservices, DEvops, and Angular to become full stack Java developer.
In this video you will learn the different types of service discoveries implementations using Netflix Eureka Server, Hashicorp Consul and Apache Zookeeper an...
Learn how to create a Reactive Java Microservices Architecture using Spring Boot and JHipster. Spring Boot 2.0 introduced a new web framework called Spring WebFlux. WebFlux offers a way for developers to do reactive programming. Java has been at the forefront of microservice architectures since they came to prominence a few years ago. It’s a popular language with well-known, high-quality frameworks, like Spring Boot, Spring Cloud, Spring Data, and Spring Security.