Skip to main content

2017 | Buch

Learn Microservices with Spring Boot

A Practical Approach to RESTful Services using RabbitMQ, Eureka, Ribbon, Zuul and Cucumber

insite
SUCHEN

Über dieses Buch

Build a microservices architecture with Spring Boot, by evolving an application from a small monolith to an event-driven architecture composed of several services. This book follows an incremental approach to teach microservice structure, test-driven development, Eureka, Ribbon, Zuul, and end-to-end tests with Cucumber.
Author Moises Macero follows a very pragmatic approach to explain the benefits of using this type of software architecture, instead of keeping you distracted with theoretical concepts. He covers some of the state-of-the-art techniques in computer programming, from a practical point of view. You’ll focus on what's important, starting with the minimum viable product but keeping the flexibility to evolve it.
What You'll LearnBuild microservices with Spring Boot
Use event-driven architecture and messaging with RabbitMQ
Create RESTful services with Spring
Master service discovery with Eureka and load balancing with Ribbon
Route requests with Zuul as your API gateway
Write end-to-end rests for an event-driven architecture using Cucumber
Carry out continuous integration and deployment

Who This Book Is For
Those with at least some prior experience with Java programming. Some prior exposure to Spring Boot recommended but not required.

Inhaltsverzeichnis

Frontmatter
Chapter 1. Introduction
Abstract
Microservices are getting very popular these days. It’s not a surprise; this software architecture style has a lot of advantages, like flexibility and ease of scale. Mapping them into small teams in an organization also gives you a lot of efficiency in development. However, going on the adventure of microservices knowing only the benefits is a wrong call: you need to know what you are facing and be prepared for that in advance. You can get a lot of knowledge from many books and articles on the Internet but, when you get hands-on code, the story changes.
In this chapter, we introduce the approach that this book follows and we summarize its main contents. This helps you understand the wholepicture before getting into the details.
Moises Macero
Chapter 2. The Basic Spring Boot Application
Abstract
The main goal of this chapter is to introduce the functional requirements of our application and the test-driven development approach you’ll follow in this book. You’ll create a Spring Boot application by developing some basic functionality using TDD.
The chapter also sets the stage for you to think in an Agile fashion, that supports the way in which the application will evolve along the book. You take some time to understand your first business requirement, split it into sub-tasks, and think about a first unit test.
Moises Macero
Chapter 3. A Real Three-Tier Spring Boot Application
Abstract
A multitier architecture will provide our application with a more production-ready look. Most of the real-world applications follow this architecture pattern and, to be more specific, the three-tier design is the most popular one and widely extended among web applications.
Moises Macero
Chapter 4. Starting with Microservices
Abstract
Chapter 3 ended with a single deployable application that contained not only the different backend functionalities but also the frontend side. Our application is a small monolith. As an alternative, we could have started designing a complete system, identifying the different contexts (or bounded contexts) in it, mapping them to microservices, and then developing all of them from the beginning, at the same time.
Moises Macero
Chapter 5. The Microservices Journey Through Tools
Abstract
We completed the previous chapter with a pending task: finishing user story 3 and letting our users see their progress in the game. The reason is that, in order to build a good microservices architecture, we need the UI part of the system extracted in a new service so it can interact as an independent party with our multiplication and gamification services. We’ll cover the reasoning with more detail in the next section.
Moises Macero
Chapter 6. Testing the Distributed System
Abstract
In this chapter, you’ll see the importance of having good test suites in a distributed system. You’ll realize how Cucumber and structuring the test project into layers can provide a simple and powerful solution to cover an end-to-end strategy. Cucumber provides a business-friendly language to design the test cases—Gherkin—and it integrates with Java, so it’s a choice that combines perfectly with our use case.
Also, the chapter pays extra attention to some details that can ease development—step parameterization and reusability, understanding how Cucumber works when instantiating tests, and how to benefit from dependency injection. And, most importantly, you’ll see how making your code testable makes everything simpler just by adding some optional logic to your services.
Moises Macero
Backmatter
Metadaten
Titel
Learn Microservices with Spring Boot
verfasst von
Moises Macero
Copyright-Jahr
2017
Verlag
Apress
Electronic ISBN
978-1-4842-3165-4
Print ISBN
978-1-4842-3164-7
DOI
https://doi.org/10.1007/978-1-4842-3165-4