O'Reilly logo

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Spring: Developing Java Applications for the Enterprise

Book Description

Leverage the power of Spring MVC, Spring Boot, Spring Cloud, and additional popular web frameworks.

About This Book

  • Discover key Spring Framework-related technology standards such as Spring core, Spring-AOP, Spring data access frameworks, and Spring testing to develop robust Java applications easily
  • This course is packed with tips and tricks that demonstrate Industry best practices on developing a Spring-MVC-based application
  • Learn how to efficiently build and implement microservices in Spring, and how to use Docker and Mesos to push the boundaries and explore new possibilities

Who This Book Is For

This course is intended for Java developers interested in building enterprise-level applications with Spring Framework. Prior knowledge of Java programming and web development concepts (and a basic knowledge of XML) is expected.

What You Will Learn

  • Understand the architecture of Spring Framework and how to set up the key components of the Spring Application Development Environment
  • Configure Spring Container and manage Spring beans using XML and Annotation
  • Practice Spring AOP concepts such as Aspect, Advice, Pointcut, and Introduction
  • Integrate bean validation and custom validation
  • Use error handling and exception resolving
  • Get to grips with REST-based web service development and Ajax
  • Use Spring Boot to develop microservices
  • Find out how to avoid common pitfalls when developing microservices
  • Get familiar with end-to-end microservices written in Spring Framework and Spring Boot

In Detail

This carefully designed course aims to get you started with Spring, the most widely adopted Java framework, and then goes on to more advanced topics such as building microservices using Spring Boot within Spring. With additional coverage of popular web frameworks such as Struts, WebWork, Java Server Faces, Tapestry, Docker, and Mesos, you'll have all the skills and expertise you need to build great applications.

Starting with the Spring Framework architecture and setting up the key components of the Spring Application Development Environment, you will learn how to configure Spring Container and manage Spring beans using XML and Annotation. Next, you will delve into Spring MVC, which will help you build flexible and loosely coupled web applications. You'll also get to grips with testing applications for reliability. Moving on, this course will help you implement the microservice architecture in Spring Framework, Spring Boot, and Spring Cloud. Written to the latest specifications of Spring, this book will help you build modern, Internet-scale Java applications in no time.

This Learning Path combines some of the best that Packt has to offer in one complete, curated package. It includes content from the following Packt products:

  • Learning Spring Application Development by Ravi Kant Soni
  • Spring MVC Beginner's Guide - Second Edition by Amuthan Ganeshan
  • Spring Microservices by Rajesh RV

Style and approach

This is a step-by-step guide for building a complete application and developing scalable microservices using Spring Framework, Spring Boot, and a set of Spring Cloud components

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 code file.

Table of Contents

  1. Spring: Developing Java Applications for the Enterprise
    1. Table of Contents
    2. Spring: Developing Java Applications for the Enterprise
    3. Spring: Developing Java Applications for the Enterprise
    4. Credits
    5. Preface
      1. What this learning path covers
      2. What you need for this learning path
      3. Who this learning path is for
      4. Reader feedback
      5. Customer support
        1. Downloading the example code
        2. Errata
        3. Piracy
        4. Questions
    6. 1. Module 1
      1. 1. Introducing the Spring Framework
        1. Introducing Spring
          1. Features of Spring
          2. Other features of Spring
        2. Evolution of the Spring Framework
        3. Spring Framework Architecture
          1. Spring Core Container
          2. The AOP module
          3. Data access/integration
          4. The Web module
          5. The Test module
        4. Benefits of the Spring Framework
        5. Creating an application in Spring
          1. Obtaining Spring JAR files
          2. Understanding Spring packaging
          3. SpringSource Tool Suite
          4. The Spring application
            1. Creating a Spring project
            2. Adding required libraries
            3. Creating source files
            4. Creating the Spring bean configuration file
            5. Running the program
        6. Exercise
        7. Summary
      2. 2. Inversion of Control in Spring
        1. Understanding Inversion of Control
          1. What is a container
          2. Spring Container
            1. Beans
              1. XML-based bean configuration
            2. BeanFactory
              1. What is a factory pattern?
              2. Spring BeanFactory
              3. Implementation of BeanFactory
            3. ApplicationContext
              1. Implementation of ApplicationContext
        2. Dependency Injection
          1. Dependency Injection in Spring
            1. The Has-A relationship
            2. Constructor-based Dependency Injection
              1. The <constructor-arg> element
              2. Constructor Injection – injecting simple Java types
              3. Constructor Injection – resolving ambiguity
                1. No ambiguity
                  1. Solution – use index attribute
                2. Parameter ambiguity
                  1. Solution – use type attribute
            3. The setter-based Dependency Injection
              1. The <property> element
              2. Setter Injection – injecting a simple Java type
              3. Setter Injection – injecting collections
          2. Injecting inner beans
          3. Injecting null and empty string values in Spring
            1. Case 1 – injecting an empty string
            2. Case 2 – injecting a null value
        3. Bean definition inheritance
          1. Inheritance with abstract
        4. Autowiring in Spring
          1. Autowiring modes
            1. Autowiring using the no option
            2. Autowiring using the byname option
              1. Case 1 – if id=" employeeDao"
              2. Case 2 – if id=" employeeDaoBean"
            3. Autowiring using the byType option
            4. Autowiring using the constructor
        5. The bean's scope
          1. Singleton
          2. Prototype
          3. Request
          4. Session
          5. Global session
        6. The Spring bean life cycle
          1. Initialization
          2. Activation
          3. Destruction
          4. Initialization callbacks
            1. Implementing the org.springframework.beans.factory.InitializingBean interface
            2. Using init-method in the XML configuration
          5. Destruction callbacks
            1. Implementing the org.springframework.beans.factory.DisposableBean interface
            2. Using destroy-method in the XML configuration
        7. Exercise
        8. Summary
      3. 3. DAO and JDBC in Spring
        1. Overview of database
        2. The DAO design pattern
          1. The DAO layer
        3. JDBC without Spring
          1. Sample code
            1. ADD drivers specific to database into the project
            2. Directory structure of the application
              1. The Employee.java file
              2. The EmployeeDao.java file
              3. The EmployeeDaoImpl.java file
              4. The HrPayrollSystem.java file
        4. Spring JDBC packages
        5. JDBC with Spring
          1. DataSource
          2. DataSource in the DAO class
            1. Directory structure of the application
              1. The EmployeeDaoImpl.java file
              2. The HrPayrollSystem.java file
        6. What is JdbcTemplate
          1. Configuring the JdbcTemplate object as Spring bean
            1. The Spring.xml file
          2. Functionality exposed by the JdbcTemplate class
            1. Querying (select)
            2. Updating (Insert-Update-Delete)
            3. Other JdbcTemplate operations
          3. Directory structure of the application
            1. The Employee.java file
            2. The EmployeeDao.java file
            3. The EmployeeDaoImpl.java file
        7. JDBC batch operation in Spring
          1. Directory structure of the application
            1. The EmployeeDaoImpl.java file
            2. The HrPayrollBatchUpdate.java file
        8. Calling a stored procedure
          1. Using the SimpleJdbcCall class
            1. Calling a stored procedure
              1. The EmployeeDaoImpl.java file
        9. Exercise
        10. Summary
      4. 4. Hibernate with Spring
        1. Why Object/Relational Mapping?
        2. Introducing ORM, O/RM, and O/R mapping
        3. Introducing Hibernate
          1. Hibernate architecture
            1. Configuration
            2. SessionFactory
            3. Session
            4. Transaction
            5. Query
            6. Criteria
            7. The Persistent object
        4. Integrating Hibernate with the Spring Framework
          1. Sample data model for example code
          2. Integrating Hibernate
          3. Required JARs for the Spring-Hibernate project
          4. Configuring Hibernate SessionFactory in Spring
            1. XML Spring configuration for Hibernate
              1. hibernate.properties
          5. Annotated domain model class
          6. The Hibernate sessions
            1. The Session interface methods
          7. Persistence layer – implement DAOs
            1. The EmployeeDao interface
            2. The EmployeeDaoImpl class
          8. Service layer – implement services
            1. The EmployeeService interface
            2. The EmployeeServiceImpl class
          9. Directory structure of the application
          10. Running the application
            1. The DBUtils class
            2. The SpringHibernateMain class
            3. Output to console
            4. Populated data in the Employee table
        5. Hibernate Query Language
          1. The Query interface
          2. Database operation using HQL
            1. The FROM clause
            2. The AS clause
            3. The SELECT clause
            4. The WHERE clause
            5. The ORDER BY clause
            6. The GROUP BY clause
            7. Using the named parameter
            8. The UPDATE clause
            9. The DELETE clause
            10. Pagination using Query
        6. Hibernate Criteria Query Language
          1. The Criteria interface
            1. Restrictions with Criteria
              1. The eq method
              2. The gt method
              3. The lt method
              4. The like method
              5. The ilike method
              6. The between method
              7. The isNull method
              8. The isNotNull method
              9. The And or OR condition
                1. Restrictions.and
                2. Restrictions.or
              10. Pagination using Criteria
              11. Sorting the results
        7. Exercise
        8. Summary
      5. 5. Spring Security
        1. What is Spring Security?
          1. Major operations
        2. Servlet filters review
        3. Security use case
        4. Spring Security configuration
          1. Spring Security setup
            1. Adding JARs to the classpath
            2. Spring Security dependencies – pom.xml
          2. Namespace configuration
        5. Securing web application's URL access
          1. The first step – web.xml
          2. Separating security configurations
        6. Logging into web application
          1. HTTP basic authentication
          2. Form-based login service
          3. Logout service
          4. Anonymous login
          5. Remember Me support
        7. Users authentication
          1. Users authentication with in-memory definitions
          2. Users authentication against database
          3. Encrypting passwords
        8. Method-level security
        9. Let's get down to business
          1. Project structure
          2. Adding filters to web.xml
          3. Resolving your view
          4. Let's add a custom login
          5. Mapping your login requests
          6. Obtaining the employee list
          7. Let's see some credentials
          8. Time to log out
          9. Running the application
        10. Exercise
        11. Summary
      6. 6. Spring Testing
        1. Testing using JUnit 4
          1. JUnit 4 annotations
          2. Assert methods
          3. An example of JUnit 4
        2. Testing using TestNG
          1. TestNG annotations
          2. Example of TestNG
        3. Agile software testing
          1. Unit testing
            1. Unit testing for isolated classes
            2. Unit testing for dependent class using mock objects
            3. The Mockito framework
          2. Integration testing
        4. Create unit tests of the Spring MVC controller
        5. Spring MVC test framework
          1. Required dependencies
          2. Annotations in Spring testing
            1. The @ContextConfiguration annotation
            2. The @WebAppConfiguration annotation
          3. MockMvc
            1. Assertion
          4. @RunWith(SpringJUnit4ClassRunner.class)
        6. Exercise
        7. Summary
      7. 7. Integrating JavaMail and JMS with Spring
        1. E-mail support in Spring
          1. Introducing the JavaMail API
          2. Using the JavaMail API
          3. The Spring API for JavaMail
          4. Developing a Spring Mail Application
            1. Configuration file – Spring.xml
            2. Spring's e-mail sender
            3. The MailerTest class
        2. Spring Java Messaging Service
          1. What is a message and messaging?
          2. What is JMS?
          3. The JMS application
            1. JMS components
          4. MOM Service Provider
            1. Configuring ActiveMQ – message queue
          5. The Spring bean configuration (Spring.xml)
          6. MessageSender.java – Spring JMS Template
          7. App.java
          8. Start ActiveMQ
          9. Output
          10. Monitoring the broker
          11. Exception on running App.java
        3. Exercise
        4. Summary
      8. A. Solutions to Exercises
        1. Chapter 1, Introducing the Spring Framework
        2. Chapter 2, Inversion of Control in Spring
        3. Chapter 3, DAO and JDBC in Spring
        4. Chapter 4, Hibernate with Spring
        5. Chapter 5, Spring Security
        6. Chapter 6, Spring Testing
        7. Chapter 7, Integrating JavaMail and JMS with Spring
      9. B. Setting up the Application Database – Apache Derby
    7. 2. Module 2
      1. 1. Configuring a Spring Development Environment
        1. Setting up Java
          1. Time for action - installing JDK
          2. Time for action - setting up environment variables
        2. Configuring a build tool
          1. Time for action - installing the Maven build tool
        3. Installing a web server
          1. Time for action - installing the Tomcat web server
        4. Configuring a development environment
          1. Time for action - installing Spring Tool Suite
          2. Time for action - configuring Maven on STS
          3. Time for action - configuring Tomcat on STS
        5. Creating our first Spring MVC project
          1. Time for action - creating a Spring MVC project in STS
          2. Time for action - adding Java version properties in pom.xml
          3. What just happened?
        6. Spring MVC dependencies
          1. Time for action - adding Spring jars to the project
          2. What just happened?
        7. A jump-start to MVC
          1. Time for action - adding a welcome page
          2. What just happened?
        8. The Dispatcher servlet
          1. Time for action - configuring the Dispatcher servlet
          2. What just happened?
        9. Deploying our project
          1. Time for action - running the project
        10. Summary
      2. 2. Spring MVC Architecture – Architecting Your Web Store
        1. Dispatcher servlet
          1. Time for action - examining request mapping
          2. What just happened?
          3. Pop quiz – request mapping
        2. Understanding the Dispatcher servlet configuration
          1. Time for action - examining the servlet mapping
          2. What just happened?
        3. Servlet mapping versus request mapping
          1. Pop quiz - servlet mapping
        4. Web application context
        5. View resolvers
          1. Time for action - understanding web application context
          2. What just happened?
        6. Understanding the web application context configuration
          1. Pop quiz - web application context configuration
        7. Model View Controller
        8. Overview of the Spring MVC request flow
        9. The web application architecture
        10. The Domain layer
          1. Time for action - creating a domain object
          2. What just happened?
        11. The Persistence layer
          1. Time for action - creating a repository object
          2. What just happened?
        12. The Service layer
          1. Time for action - creating a service object
          2. What just happened?
          3. Have a go hero - accessing the product domain object via a service
        13. An overview of the web application architecture
          1. Have a go hero - listing all our customers
        14. Summary
      3. 3. Control Your Store with Controllers
        1. The role of a Controller in Spring MVC
        2. Defining a Controller
          1. Time for action - adding class-level request mapping
          2. What just happened?
        3. Default request mapping method
          1. Pop quiz - class level request mapping
        4. Handler mapping
        5. Using URI template patterns
          1. Time for action - showing products based on category
          2. What just happened?
          3. Pop quiz - request path variable
        6. Using matrix variables
          1. Time for action - showing products based on filters
          2. What just happened?
        7. Understanding request parameters
          1. Time for action - adding a product detail page
          2. What just happened?
          3. Pop quiz - the request parameter
          4. Time for action - implementing a master detail View
          5. What just happened?
          6. Have a go hero - adding multiple filters to list products
        8. Summary
      4. 4. Working with Spring Tag Libraries
        1. The JavaServer Pages Standard Tag Library
        2. Serving and processing forms
          1. Time for action - serving and processing forms
          2. What just happened?
          3. Have a go hero - customer registration form
        3. Customizing data binding
          1. Time for action - whitelisting form fields for binding
          2. What just happened?
          3. Pop quiz - data binding
        4. Externalizing text messages
          1. Time for action - externalizing messages
          2. What just happened?
          3. Have a go hero - externalizing all the labels from all the pages
        5. Summary
      5. 5. Working with View Resolver
        1. Resolving Views
        2. RedirectView
          1. Time for action - examining RedirectView
          2. What just happened?
          3. Pop quiz - RedirectView
        3. Flash attribute
        4. Serving static resources
          1. Time for action - serving static resources
          2. What just happened?
          3. Pop quiz - static view
          4. Time for action - adding images to the product detail page
          5. What just happened?
        5. Multipart requests in action
          1. Time for action - adding images to a product
          2. What just happened?
          3. Have a go hero - uploading product user manuals to the server
        6. Using ContentNegotiatingViewResolver
          1. Time for action - configuring ContentNegotiatingViewResolver
          2. What just happened?
        7. Working with HandlerExceptionResolver
          1. Time for action - adding a ResponseStatus exception
          2. What just happened?
          3. Time for action - adding an exception handler
          4. What just happened?
        8. Summary
      6. 6. Internalize Your Store with Interceptor
        1. Working with interceptors
          1. Time for action - configuring an interceptor
          2. What just happened?
          3. Pop quiz - interceptors
        2. LocaleChangeInterceptor - internationalization
          1. Time for action - adding internationalization
          2. What just happened?
          3. Have a go hero - fully internationalize the product details page
        3. Mapped interceptors
          1. Time for action - mapped intercepting offer page requests
          2. What just happened?
        4. Summary
      7. 7. Incorporating Spring Security
        1. Using Spring Security
          1. Time for action - authenticating users based on roles
          2. What just happened?
          3. Pop quiz - Spring Security
          4. Have a go hero - play with Spring Security
        2. Summary
      8. 8. Validate Your Products with a Validator
        1. Bean Validation
          1. Time for action - adding Bean Validation support
          2. What just happened?
          3. Have a go hero - adding more validation in the Add new product page
        2. Custom validation with JSR-303/Bean Validation
          1. Time for action - adding Bean Validation support
          2. What just happened?
          3. Have a go hero - adding custom validation to a category
        3. Spring validation
          1. Time for action - adding Spring validation
          2. What just happened?
          3. Time for action - combining Spring validation and Bean Validation
          4. What just happened?
          5. Have a go hero - adding Spring validation to a product image
        4. Summary
      9. 9. Give REST to Your Application with Ajax
        1. Introduction to REST
          1. Time for action - implementing RESTful web services
          2. What just happened?
          3. Time for action - consuming REST web services
          4. What just happened?
        2. Handling web services in Ajax
          1. Time for action - consuming REST web services via Ajax
        3. What just happened?
        4. Summary
      10. 10. Float Your Application with Web Flow
        1. Working with Spring Web Flow
          1. Time for action - implementing the order processing service
          2. What just happened?
          3. Time for action - implementing the checkout flow
          4. What just happened?
        2. Understanding flow definitions
        3. Understanding checkout flow
          1. Pop quiz - web flow
          2. Time for action - creating Views for every view state
          3. What just happened?
          4. Have a go hero - adding a decision state
        4. Summary
      11. 11. Template with Tiles
        1. Enhancing reusability through Apache Tiles
          1. Time for action - creating Views for every View state
          2. What just happened?
          3. Pop quiz - Apache Tiles
        2. Summary
      12. 12. Testing Your Application
        1. Unit testing
          1. Time for action - unit testing domain objects
          2. What just happened?
          3. Have a go hero - adding tests for Cart
        2. Integration testing with the Spring Test context framework
          1. Time for action - testing product validator
          2. What just happened?
          3. Time for action - testing product Controllers
          4. What just happened?
          5. Time for action - testing REST Controllers
          6. What just happened?
          7. Have a go hero - adding tests for the remaining REST methods
        3. Summary
        4. Thank you readers!
      13. A. Using the Gradle Build Tool
        1. Installing Gradle
        2. The Gradle build script for your project
        3. Understanding the Gradle script
      14. B. Pop Quiz Answers
        1. Chapter 2, Spring MVC Architecture - Architecting Your Web Store
        2. Chapter 3, Control Your Store with Controllers
        3. Chapter 4, Working with Spring Tag Libraries
        4. Chapter 5, Working with View Resolver
        5. Chapter 6, Internalize Your Store with Interceptor
        6. Chapter 7, Incorporating Spring Security
        7. Chapter 10, Float Your Application with Web Flow
        8. Chapter 11, Template with Tiles
    8. 3. Module 3
      1. 1. Demystifying Microservices
        1. The evolution of microservices
          1. Business demand as a catalyst for microservices evolution
          2. Technology as a catalyst for the microservices evolution
          3. Imperative architecture evolution
        2. What are microservices?
        3. Microservices – the honeycomb analogy
        4. Principles of microservices
          1. Single responsibility per service
          2. Microservices are autonomous
        5. Characteristics of microservices
          1. Services are first-class citizens
            1. Characteristics of services in a microservice
          2. Microservices are lightweight
          3. Microservices with polyglot architecture
          4. Automation in a microservices environment
          5. Microservices with a supporting ecosystem
          6. Microservices are distributed and dynamic
          7. Antifragility, fail fast, and self-healing
        6. Microservices examples
          1. An example of a holiday portal
          2. A microservice-based order management system
          3. An example of a travel agent portal
        7. Microservices benefits
          1. Supports polyglot architecture
          2. Enabling experimentation and innovation
          3. Elastically and selectively scalable
          4. Allowing substitution
          5. Enabling to build organic systems
          6. Helping reducing technology debt
          7. Allowing the coexistence of different versions
          8. Supporting the building of self-organizing systems
          9. Supporting event-driven architecture
          10. Enabling DevOps
        8. Relationship with other architecture styles
          1. Relations with SOA
            1. Service-oriented integration
            2. Legacy modernization
            3. Service-oriented application
            4. Monolithic migration using SOA
          2. Relations with Twelve-Factor apps
            1. A single code base
            2. Bundling dependencies
            3. Externalizing configurations
            4. Backing services are addressable
            5. Isolation between build, release, and run
            6. Stateless, shared nothing processes
            7. Exposing services through port bindings
            8. Concurrency to scale out
            9. Disposability with minimal overhead
            10. Development and production parity
            11. Externalizing logs
            12. Package admin processes
        9. Microservice use cases
          1. Microservices early adopters
          2. The common theme is monolithic migrations
        10. Summary
      2. 2. Building Microservices with Spring Boot
        1. Setting up a development environment
        2. Developing a RESTful service – the legacy approach
        3. Moving from traditional web applications to microservices
        4. Using Spring Boot to build RESTful microservices
        5. Getting started with Spring Boot
        6. Developing the Spring Boot microservice using the CLI
        7. Developing the Spring Boot Java microservice using STS
          1. Examining the POM file
          2. Examining Application.java
          3. Examining application.properties
          4. Examining ApplicationTests.java
          5. Testing the Spring Boot microservice
        8. Developing the Spring Boot microservice using Spring Initializr – the HATEOAS example
        9. What's next?
        10. The Spring Boot configuration
          1. Understanding the Spring Boot autoconfiguration
          2. Overriding default configuration values
          3. Changing the location of the configuration file
          4. Reading custom properties
          5. Using a .yaml file for configuration
          6. Using multiple configuration profiles
          7. Other options to read properties
        11. Changing the default embedded web server
        12. Implementing Spring Boot security
          1. Securing microservices with basic security
          2. Securing a microservice with OAuth2
        13. Enabling cross-origin access for microservices
        14. Implementing Spring Boot messaging
        15. Developing a comprehensive microservice example
        16. Spring Boot actuators
          1. Monitoring using JConsole
          2. Monitoring using SSH
        17. Configuring application information
        18. Adding a custom health module
          1. Building custom metrics
        19. Documenting microservices
        20. Summary
      3. 3. Applying Microservices Concepts
        1. Patterns and common design decisions
          1. Establishing appropriate microservice boundaries
            1. Autonomous functions
            2. Size of a deployable unit
            3. Most appropriate function or subdomain
            4. Polyglot architecture
            5. Selective scaling
            6. Small, agile teams
            7. Single responsibility
            8. Replicability or changeability
            9. Coupling and cohesion
            10. Think microservice as a product
          2. Designing communication styles
            1. Synchronous style communication
            2. Asynchronous style communication
            3. How to decide which style to choose?
          3. Orchestration of microservices
          4. How many endpoints in a microservice?
          5. One microservice per VM or multiple?
          6. Rules engine – shared or embedded?
          7. Role of BPM and workflows
          8. Can microservices share data stores?
          9. Setting up transaction boundaries
            1. Altering use cases to simplify transactional requirements
            2. Distributed transaction scenarios
          10. Service endpoint design consideration
            1. Contract design
            2. Protocol selection
              1. Message-oriented services
              2. HTTP and REST endpoints
              3. Optimized communication protocols
              4. API documentations
          11. Handling shared libraries
          12. User interfaces in microservices
          13. Use of API gateways in microservices
          14. Use of ESB and iPaaS with microservices
          15. Service versioning considerations
          16. Design for cross origin
          17. Handling shared reference data
          18. Microservices and bulk operations
        2. Microservices challenges
          1. Data islands
          2. Logging and monitoring
          3. Dependency management
          4. Organization culture
          5. Governance challenges
          6. Operation overheads
          7. Testing microservices
          8. Infrastructure provisioning
        3. The microservices capability model
          1. Core capabilities
          2. Infrastructure capabilities
          3. Supporting capabilities
          4. Process and governance capabilities
        4. Summary
      4. 4. Microservices Evolution – A Case Study
        1. Reviewing the microservices capability model
        2. Understanding the PSS application
          1. Business process view
          2. Functional view
          3. Architectural view
          4. Design view
          5. Implementation view
          6. Deployment view
        3. Death of the monolith
          1. Pain points
          2. Stop gap fix
          3. Retrospection
            1. Shared data
            2. Single database
              1. Native queries
              2. Stored procedures
            3. Domain boundaries
        4. Microservices to the rescue
        5. The business case
        6. Plan the evolution
          1. Evolutionary approach
          2. Identification of microservices boundaries
            1. Analyze dependencies
              1. Events as opposed to query
              2. Events as opposed to synchronous updates
              3. Challenge requirements
              4. Challenge service boundaries
              5. Final dependency graph
          3. Prioritizing microservices for migration
          4. Data synchronization during migration
          5. Managing reference data
          6. User interfaces and web applications
            1. Session handling and security
          7. Test strategy
          8. Building ecosystem capabilities
        7. Migrate modules only if required
        8. Target architecture
          1. Internal layering of microservices
          2. Orchestrating microservices
          3. Integration with other systems
          4. Managing shared libraries
          5. Handling exceptions
        9. Target implementation view
          1. Implementation projects
          2. Running and testing the project
        10. Summary
      5. 5. Scaling Microservices with Spring Cloud
        1. Reviewing microservices capabilities
        2. Reviewing BrownField's PSS implementation
        3. What is Spring Cloud?
          1. Spring Cloud releases
          2. Components of Spring Cloud
            1. Spring Cloud and Netflix OSS
        4. Setting up the environment for BrownField PSS
        5. Spring Cloud Config
          1. What's next?
          2. Setting up the Config server
          3. Understanding the Config server URL
            1. Accessing the Config Server from clients
          4. Handling configuration changes
          5. Spring Cloud Bus for propagating configuration changes
          6. Setting up high availability for the Config server
          7. Monitoring the Config server health
          8. Config server for configuration files
          9. Completing changes to use the Config server
        6. Feign as a declarative REST client
        7. Ribbon for load balancing
        8. Eureka for registration and discovery
          1. Understanding dynamic service registration and discovery
          2. Understanding Eureka
          3. Setting up the Eureka server
          4. High availability for Eureka
        9. Zuul proxy as the API gateway
          1. Setting up Zuul
          2. High availability of Zuul
            1. High availability of Zuul when the client is also a Eureka client
            2. High availability when the client is not a Eureka client
          3. Completing Zuul for all other services
        10. Streams for reactive microservices
        11. Summarizing the BrownField PSS architecture
        12. Summary
      6. 6. Autoscaling Microservices
        1. Reviewing the microservice capability model
        2. Scaling microservices with Spring Cloud
        3. Understanding the concept of autoscaling
          1. The benefits of autoscaling
          2. Different autoscaling models
            1. Autoscaling an application
            2. Autoscaling the infrastructure
          3. Autoscaling in the cloud
        4. Autoscaling approaches
          1. Scaling with resource constraints
          2. Scaling during specific time periods
          3. Scaling based on the message queue length
          4. Scaling based on business parameters
          5. Predictive autoscaling
        5. Autoscaling BrownField PSS microservices
          1. The capabilities required for an autoscaling system
          2. Implementing a custom life cycle manager using Spring Boot
          3. Understanding the deployment topology
          4. Understanding the execution flow
          5. A walkthrough of the life cycle manager code
          6. Running the life cycle manager
        6. Summary
      7. 7. Logging and Monitoring Microservices
        1. Reviewing the microservice capability model
        2. Understanding log management challenges
        3. A centralized logging solution
        4. The selection of logging solutions
          1. Cloud services
          2. Off-the-shelf solutions
          3. Best-of-breed integration
            1. Log shippers
            2. Log stream processors
            3. Log storage
            4. Dashboards
          4. A custom logging implementation
          5. Distributed tracing with Spring Cloud Sleuth
        5. Monitoring microservices
          1. Monitoring challenges
          2. Monitoring tools
          3. Monitoring microservice dependencies
          4. Spring Cloud Hystrix for fault-tolerant microservices
          5. Aggregating Hystrix streams with Turbine
        6. Data analysis using data lakes
        7. Summary
      8. 8. Containerizing Microservices with Docker
        1. Reviewing the microservice capability model
        2. Understanding the gaps in BrownField PSS microservices
        3. What are containers?
        4. The difference between VMs and containers
        5. The benefits of containers
        6. Microservices and containers
        7. Introduction to Docker
          1. The key components of Docker
            1. The Docker daemon
            2. The Docker client
          2. Docker concepts
            1. Docker images
            2. Docker containers
            3. The Docker registry
            4. Dockerfile
        8. Deploying microservices in Docker
        9. Running RabbitMQ on Docker
        10. Using the Docker registry
          1. Setting up the Docker Hub
          2. Publishing microservices to the Docker Hub
        11. Microservices on the cloud
          1. Installing Docker on AWS EC2
        12. Running BrownField services on EC2
        13. Updating the life cycle manager
        14. The future of containerization – unikernels and hardened security
        15. Summary
      9. 9. Managing Dockerized Microservices with Mesos and Marathon
        1. Reviewing the microservice capability model
        2. The missing pieces
        3. Why cluster management is important
        4. What does cluster management do?
        5. Relationship with microservices
        6. Relationship with virtualization
        7. Cluster management solutions
          1. Docker Swarm
          2. Kubernetes
          3. Apache Mesos
          4. Nomad
          5. Fleet
        8. Cluster management with Mesos and Marathon
          1. Diving deep into Mesos
            1. The Mesos architecture
            2. Marathon
        9. Implementing Mesos and Marathon for BrownField microservices
          1. Setting up AWS
          2. Installing ZooKeeper, Mesos, and Marathon
            1. Configuring ZooKeeper
            2. Configuring Mesos
            3. Running Mesos, Marathon, and ZooKeeper as services
              1. Running the Mesos slave in the command line
            4. Preparing BrownField PSS services
            5. Deploying BrownField PSS services
            6. Reviewing the deployment
        10. A place for the life cycle manager
          1. Rewriting the life cycle manager with Mesos and Marathon
        11. The technology metamodel
        12. Summary
      10. 10. The Microservices Development Life Cycle
        1. Reviewing the microservice capability model
        2. The new mantra of lean IT – DevOps
          1. Reducing wastage
          2. Automating every possible step
          3. Value-driven delivery
          4. Bridging development and operations
        3. Meeting the trio – microservices, DevOps, and cloud
          1. Cloud as the self-service infrastructure for Microservices
          2. DevOps as the practice and process for microservices
        4. Practice points for microservices development
          1. Understanding business motivation and value
          2. Changing the mindset from project to product development
          3. Choosing a development philosophy
            1. Design thinking
            2. The start-up model
            3. The Agile practice
          4. Using the concept of Minimum Viable Product
          5. Overcoming the legacy hotspot
          6. Addressing challenges around databases
          7. Establishing self-organizing teams
          8. Building a self-service cloud
          9. Building a microservices ecosystem
          10. Defining a DevOps-style microservice life cycle process
            1. Value-driven planning
            2. Agile development
            3. Continuous integration
            4. Continuous testing
            5. Continuous release
            6. Continuous monitoring and feedback
          11. Automating the continuous delivery pipeline
            1. Development
            2. Continuous integration
            3. Automated testing
              1. Different candidate tests for automation
                1. Automated sanity tests
                2. Regression testing
                3. Automated functional testing
                4. Automated acceptance testing
                5. Performance testing
                6. Real user flow simulation or journey testing
                7. Automated security testing
                8. Exploratory testing
                9. A/B testing, canary testing, and blue-green deployments
                10. Other nonfunctional tests
                11. Testing in production
                12. Antifragility testing
              2. Target test environments
            4. Continuous deployment
            5. Monitoring and feedback
          12. Automated configuration management
        5. Microservices development governance, reference architectures, and libraries
        6. Summary
    9. Bibliography
    10. Index