Book description
Learn and use the design patterns and best practices in Spring to solve common design problems and build user-friendly microservices
Key Features
- Study the benefits of using the right design pattern in your toolkit
- Manage your code easily with Spring's dependency injection pattern
- Explore the features of Docker and Mesos to build successful microservices
Book Description
Getting Started with Spring Microservices begins with an overview of the Spring Framework 5.0, its design patterns, and its guidelines that enable you to implement responsive microservices at scale. You will learn how to use GoF patterns in application design. You will understand the dependency injection pattern, which is the main principle behind the decoupling process of the Spring Framework and makes it easier to manage your code. Then, you will learn how to use proxy patterns in aspect-oriented programming and remoting. Moving on, you will understand the JDBC template patterns and their use in abstracting database access.
After understanding the basics, you will move on to more advanced topics, such as reactive streams and concurrency. Written to the latest specifications of Spring that focuses on Reactive Programming, the Learning Path teaches you how to build modern, internet-scale Java applications in no time.
Next, you will understand how Spring Boot is used to deploying serverless autonomous services by removing the need to have a heavyweight application server. You'll also explore ways to deploy your microservices to Docker and managing them with Mesos.
By the end of this Learning Path, you will have the clarity and confidence for implementing microservices using Spring Framework.
This Learning Path includes content from the following Packt products:
- Spring 5 Microservices by Rajesh R V
- Spring 5 Design Patterns by Dinesh Rajput
What you will learn
- Develop applications using dependency injection patterns
- Build web applications using traditional Spring MVC patterns
- Utilize the reactive programming pattern to build reactive web apps
- Learn concurrency and handle multiple connections inside a web server
- Use Spring Boot and Spring Cloud to develop microservices
- Leverage reactive programming to build cloud-native applications
Who this book is for
Getting Started with Spring Microservices is ideal for Spring developers who want to use design patterns to solve common design problems and build cloud-ready, Internet-scale applications, and simple RESTful services.
Downloading the example code for this book You can download the example code files for all Packt books you have purchased from your account at http://www.PacktPub.com. If you purchased this book elsewhere, you can visit http://www.PacktPub.com/support and register to have the files e-mailed directly to you.
Publisher resources
Table of contents
- Title Page
- Copyright
- About Packt
- Contributors
- Preface
-
Getting Started with Spring Framework 5.0 and Design Patterns
- Introducing Spring Framework
- Simplifying application development using Spring and its pattern
- Using a Spring container to manage beans with the Factory pattern
- Life of a bean in the container
- Spring modules
- New features in Spring Framework 5.0
- Summary
- Overview of GOF Design Patterns - Core Design Patterns
-
Wiring Beans using the Dependency Injection Pattern
- The dependency injection pattern
- Types of dependency injection patterns
- Configuring the dependency injection pattern with Spring
- Dependency injection pattern with Java-based configuration
- Dependency injection pattern with XML-based configuration
- Dependency injection pattern with Annotation-based configuration
- Best practices for configuring the DI pattern
- Summary
- Spring Aspect Oriented Programming with Proxy and Decorator pattern
- Accessing a Database with Spring and JDBC Template Patterns
-
Improving Application Performance Using Caching Patterns
- What is cache?
- Understanding cache abstraction
- Enabling caching via the Proxy pattern
- Declarative Annotation-based caching
- Declarative XML-based caching
- Configuring the cache storage
- Third-party cache implementations
- Creating custom caching annotations
- Top caching best practices to be used in a web application
- Summary
- Implementing Reactive Design Patterns
- Implementing Concurrency Patterns
-
Demystifying Microservices
- Evolution of microservices
- What are Microservices?
- Microservices - The honeycomb analogy
- Principles of microservices
- Characteristics of microservices
- Microservices examples
-
Microservices benefits
- Supports polyglot architecture
- Enables experimentation and innovation
- Elastically and selectively scalable
- Allows substitution
- Enables to build organic systems
- Helps managing technology debt
- Allowing co-existence of different versions
- Supporting building self-organizing systems
- Supporting event-driven architecture
- Enables DevOps
- Summary
-
Related Architecture Styles and Use Cases
- Service-Oriented Architecture (SOA)
-
Twelve-Factor Apps
- Single code base
- Bundle dependencies
- Externalizing configurations
- Backing services are addressable
- Isolation between build, release, and run
- Stateless, shared nothing processes
- Expose services through port bindings
- Concurrency for scale out
- Disposability, with minimal overhead
- Development, production parity
- Externalizing logs
- Package admin processes
- Serverless computing
- Lambda architecture
- DevOps, Cloud, and Containers
- Reactive microservices
- Microservice use cases
- Microservices early adopters - Is there a common theme?
- Microservice frameworks
- Summary
-
Building Microservices with Spring Boot
- Setting up a development environment
- Spring Boot for building RESTful microservices
- Getting started with Spring Boot
- Developing a Spring Boot microservice
- Developing our first Spring Boot microservice
- HATEOAS-enabled Spring Boot microservice
- Reactive Spring Boot microservices
- Implementing security
- Enabling cross origin for microservices interactions
- Spring Boot actuators for microservices instrumentation
- Documenting microservices
- Putting it all together - Developing a customer registration microservice example
- Summary
-
Scale Microservices with Spring Cloud Components
- What is Spring Cloud?
- Spring Cloud releases
- Setting up the environment for the BrownField PSS
-
Spring Cloud Config
- Building microservices with Config Server
- Setting up the Config Server
- Understanding the Config Server URL
- Handling configuration changes
- Spring Cloud Bus for propagating configuration changes
- Setting up high availability for the Config Server
- Monitoring Config Server health
- Config Server for configuration files
- Completing changes to use Config Server
- Eureka for registration and discovery
- Zuul proxy as the API Gateway
- Streams for reactive microservices
- Protecting microservices with Spring Cloud Security
- Summarising the BrownField PSS architecture
- Summary
- Logging and Monitoring Microservices
-
Containerizing Microservices with Docker
- Understanding gaps in the BrownField PSS microservices
- What are containers?
- Difference between VM and containers
- Benefits of containers
- Microservices and containers
- Introduction to Docker
- Deploying microservices into Docker
- Running RabbitMQ on Docker
- Using the Docker registry
- Microservices on Cloud
- Running BrownField services on EC2
- Future of containerization
- Summary
- Scaling Dockerized Microservices with Mesos and Marathon
- Other Books You May Enjoy
Product information
- Title: Building Microservices with Spring
- Author(s):
- Release date: December 2018
- Publisher(s): Packt Publishing
- ISBN: 9781789955644
You might also like
book
Spring REST: Building Java Microservices and Cloud Applications
Design and develop Java-based RESTful APIs using the latest versions of the Spring MVC and Spring …
book
Spring: Microservices with Spring Boot
Unlock the power of Spring Boot to build and deploy production-ready microservices About This Book Get …
book
Developing Java Applications with Spring and Spring Boot
An end-to-end software development guide for the Java eco-system using the most advanced frameworks: Spring and …
book
Beginning Spring Boot 2: Applications and Microservices with the Spring Framework
Learn Spring Boot and how to build Java-based enterprise, web, and microservice applications with it. In …