Skip to Main Content
Microservices for Java Developers, 2nd Edition
book

Microservices for Java Developers, 2nd Edition

by Rafael Benevides, Christian Posta
June 2019
Intermediate to advanced content levelIntermediate to advanced
117 pages
2h 28m
English
O'Reilly Media, Inc.
Content preview from Microservices for Java Developers, 2nd Edition

Chapter 2. Spring Boot for Microservices

Spring Boot is an opinionated Java framework for building microservices based on the Spring dependency injection framework. Spring Boot facilitates creation of microservices through reduced boilerplate, configuration, and developer friction. This is a similar approach to the two other frameworks we’ll look at.

Advantages of Spring Boot

Spring Boot offers the following advantages in comparison to the Spring framework:

  • Favoring automatic, conventional configuration by default

  • Curating sets of popular starter dependencies for easier consumption

  • Simplifying application packaging

  • Baking in application insight (e.g., metrics and environment info)

Simplified Configuration

Spring historically was a nightmare to configure. Although the framework improved upon other high-ceremony component models (EJB 1.x, 2.x, etc.), it did come along with its own set of heavyweight usage patterns. Namely, Spring required a lot of XML configuration and a deep understanding of the individual beans needed to construct JdbcTemplates, JmsTemplates, BeanFactory lifecycle hooks, servlet listeners, and many other components. In fact, writing a simple “Hello World” with Spring MVC required understanding of DispatcherServlet and a whole host of Model–View–Controller classes. Spring Boot aims to eliminate all of this boilerplate configuration with some implied conventions and simplified annotations—although, you can still finely tune the underlying beans if you ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Practical Microservices Architectural Patterns: Event-Based Java Microservices with Spring Boot and Spring Cloud

Practical Microservices Architectural Patterns: Event-Based Java Microservices with Spring Boot and Spring Cloud

Binildas Christudas
Spring Microservices in Action, Second Edition

Spring Microservices in Action, Second Edition

John Carnell, Illary Huaylupo Sanchez

Publisher Resources

ISBN: 9781492038290