Rapid Spring Application Development with Spring Boot 2
4.3 (3 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
38 students enrolled

Rapid Spring Application Development with Spring Boot 2

Learn how to create enterprise-ready Java applications using Spring Framework from scratch with Spring Boot 2
4.3 (3 ratings)
Course Ratings are calculated from individual students’ ratings and a variety of other signals, like age of rating and reliability, to ensure that they reflect course quality fairly and accurately.
38 students enrolled
Created by Packt Publishing
Last updated 5/2019
English [Auto]
Current price: $119.99 Original price: $199.99 Discount: 40% off
2 days left at this price!
30-Day Money-Back Guarantee
This course includes
  • 6.5 hours on-demand video
  • 1 downloadable resource
  • Full lifetime access
  • Access on mobile and TV
  • Certificate of Completion
Training 5 or more people?

Get your team access to 4,000+ top Udemy courses anytime, anywhere.

Try Udemy for Business
What you'll learn
  • Understand the microservice architecture and how this architecture drives the need for Spring Boot in a modern cloud-native application environment
  • Leverage the power of Spring Dependency Injection with Spring Boot
  • Develop custom filters that intercept HTTP servlet requests
  • Build a payment gateway application using Spring Boot 2
  • Secure your application with Spring Security
  • Deploy Spring Boot Actuator to debug your Spring Boot application in production
  • Use the Java logging framework, Log4j, to monitor application health and troubleshoot applications
Course content
Expand all 75 lectures 06:33:32
+ Professional Spring Boot 2
23 lectures 02:32:00

This video gives glimpse of the entire course.

Preview 03:24

A spring application has the complexities of configuring dependencies and manually doing all the setup required for creating a web or JPA or any other application.

  • Understand the opinionated way of configuration of Spring Boot

  • Create a project using Spring Initializer

  • Know that the project provides all dependencies and configuration

Auto Configuration with Spring Boot

Spring Boot application does a lot of auto configuration. Let’s understand how.

  • Explore the Spring Boot project pom file

  • Understand the various annotations

  • Customize the project and execute it after implementing the changes

Spring Boot Core Components

Sometimes there is a need to create and run the project from the CLI. It allows to easily run microservices creating groovy scripts.

  • Install the CLI and open the terminal

  • Create a project using CLI commands and explore CLI commands

  • Run the Spring Boot through CLI

Spring Boot CLI

Understand how to monitor the state of the Spring Boot application.

  • Enable the actuator in pom file

  • See the REST endpoints exposed by actuator

  • Explore various endpoints and monitor the operational information

Leveraging Spring Boot Actuator

Spring Boot comes in with a lot of starters to easily provide dependencies in an opinionated way and makes bootstrapping the application easier and faster

  • Understand the parent starter included by default

  • Provide various starters in pom file

  • Access the features available by the starters

Spring Boot Starters

Development environment requires auto load and deployment of applications as changes are being made

  • Provide the devtools dependency in pom file

  • Create a controller and run on server

  • See how the server restarts automatically as soon as changes are made and saved

Using Spring Boot Tools - Build Control, Loading, and Scripting.

Enhance the spring boot application to expose the REST API, integrate with database and start the server.

  • Understand the architecture of our application

  • Explore the tools and libraries used

  • Integrate these in upcoming videos

Preview 01:39

We need to override the default server provided by Spring Boot, that is, Tomcat server and integrate Jetty server. Create a first hello world application.

  • Provide the jetty dependency in the pom file

  • Create a RestController using various annotations

  • Run the controller on jetty server

Creating a Simple Jetty Web Server and Hello World Endpoint

Persistence is the key to any application. The existing Spring Boot application will be connected to database.

  • Provide postgres and jpa dependency and configure application.properties file

  • Create a CrudRepository for DAO operations and database tables

  • Create a test class and test the database operations

Creating a Data Model and Linking it to a Postgres Database

The Spring Boot application will be mapped for various REST endpoints. Understand the RequestMapping annotation.

  • Extend the controller for various request mapping

  • Understand get, post, put and delete operations

  • Test the controller on advance rest client

Building a REST API and Request Mappings

The data can be produced from the application or consumed by the application sent by the client. The data produced and consumed will now be linked to database created.

  • Create RequestParameters and access via URL

  • Access the JSON data sent by the client using RequestBody

  • See the application up and tested using ARC

Using Request Parameters and Request Body

The application will be extended to accept values passed using path variables.

  • Use the @Path annotation on the controller created

  • Send the request from ARC for path mapping

  • Explore various options of @Path annotation

Exploring Path Variables in Spring Boot

The application created has to be monitored for its status and operational information.

  • Enable the actuator in the application

  • Access the exposed REST endpoints by the actuator

  • Include HAL browser for UI for your application

Monitoring Your Application with Spring Boot Actuator

Need to consume the REST APIs created by other developers or available online.

  • Understand the RestTemplate class and invoke it

  • Call the get operations on RestTemplate object

  • Call post operation and consume the REST API

Consuming Another RESTful Service in Spring Boot

Extend the application for unit testing and mocking the service layer.

  • Add test dependency in pom file

  • Create a Test class and understand various annotations

  • Mock the service class and see the tests

Test Tooling with Mockito and JUnit

Database in testing environment does not access production environment database. Let’s mock the database and simulate its operations.

  • Create an in-memory database

  • Configure application.properties file

  • Use Database specific annotations and test database

Mocking Out the Persistence Layer for Testing

Once the application is unit tested, it needs to be tested for a real time environment integrating all the layers required by an application.

  • Annotate the test class with @SpringBootTest

  • Use TestRestTemplate class to make REST calls

  • The application is tested on real time postgres database and jetty

Running Spring Boot Integration Tests

A platform needed for developers and sysadmins to develop, deploy, and run applications with containers.

  • Understand what is Docker

  • Understand the Docker architecture

  • Install Docker, verify and run a hello world

Introduction to Docker and its Architecture

Virtual machines are being in market for virtualizing the physical hardware. Dockers came in recently to virtualize the operating system.

  • Understand what virtual machine is and what a container is

  • See the architectural difference

  • Know the difference between VM and Docker

Docker versus VMs – Core Concepts

The Spring Boot application needs to be deployed on the Docker container and run it locally using Docker commands.

  • Create a Docker file and build the image

  • Run the image and access REST API

  • Push the image on Docker Hub repository

Wrapping Spring Boot Application with a Docker Container

Amazon provides a mechanism to deploy Spring Boot application on the cloud via Amazon Fargate.

  • Understand what Amazon Fargate is

  • Know what was the need of Fargate

  • Explore the basics of Fargate

Understanding Amazon Fargate

The Spring Boot application created needs to be deployed on the AWS Fargate.

  • Create AWS account and select ECS service

  • Define Task, service and cluster

  • Access REST API by DNS provided

Deploying to AWS with Fargate
Test Your Knowledge
5 questions
+ Hands-On Application Development with Spring Boot 2
33 lectures 02:47:24

This video provides an overview of the entire course.

Preview 02:34

The aim of this video is to setup our Spring Boot Project and Spring Boot Runner and learn about Dependency Injection and Inversion of Control principle.

  • Understand Dependency Injection and Inversion of Control principle

  • Understand the need for Dependency Injection

  • Start project

Set Up the Spring Boot Project and Spring Boot Runner

The aim of this video is to understand scopes and create scope of Payment Service Bean.

  • Understand scopes and default scope

  • Learn types of annotation for defining Bean

  • Create simple @Component And @Configuration Beans

Creating Scope of Payment Service Bean

The aim of this video is to create @Configuration, @Component, and @Service beans and distinguish @Autowired – Field versus Constructor Injection.

  • Create @Service

  • Create @ControllerBean

  • Understand @Autowired – Field versus Constructor Injection

Creating @Configuration, @Component, and @Service Beans

The aim of this video is to learn how we can control lifecycle of Spring Bean.

  • Understand Spring lifecycle

  • Use @PostConstruct

  • Use @PreDestroy

Controlling Life Cycle of Spring Bean

The aim of this video is to learn using component scan to find Spring components and solve conflicts while using two Beans.

  • Create two Beans that extend same interface

  • Solve conflicts with non-unique Bean

  • Use qualifier on Beans

Using Component Scan to Find out about Spring Components

The aim of this video is to create users repository and users service and expose users via REST endpoint.

  • Create UsersRepository

  • Create UsersService

  • Expose users via REST call

Exposing Users via REST Endpoint

The aim of this video is to create and configure our filter and intercept REST calls via filter.

  • Create filter for request/response logging

  • Add configuration for a filter

  • Start test

Intercepting REST Calls via Filter

The aim of this video is to add and configure a second filter to add transaction support to REST endpoint.

  • Add second filter that adds transactions support

  • Configure transaction support filter

  • Start test

Using Filter to Add Transactions Support to the REST Endpoint

The aim of this video is to learn chaining two filters together and understand filter ordering.

  • Chain two filters together

  • Understand filter ordering

  • Understand declarative versus annotation based configuration

Plugging Filtering Logic

The aim of this video is to test logic, order, and behavior of our filter.

  • Test filter logic and ordering

  • Test filter behavior when chain() throws exception

  • Test that filter doesn’t influence other endpoints

Testing Filters

The aim of this video is to create a payment and user entity and learn about @ID annotation.

  • Create payment entity

  • Create user entity

  • Understand @Id annotation

Creating Spring Payment Entity

The aim of this video is to learn to extend CrudRepository using custom methods.

  • Extend CrudRepository for payment

  • Extend CrudRepository for user

  • Add custom methods

Extending CrudRepository with Custom Methods

The aim of this video is to write tests for CrudRepository, saving, and data retrieval.

  • Write test for CrudRepository

  • Write test for save

  • Write test for data retrieval

Testing CrudRepository

The aim of this video is to rework on our CrudRepository such that to make it work in a Reactive fashion.

  • Create Reactive payment repository

  • Write Reactive save

  • Write Reactive load

Reworking CrudRepository to Work in a Reactive Fashion

The aim of this video is to test our ReactiveCrudRepository.

  • Create ReactivePaymentController

  • Use ReactiveRepository from Reactive controller

  • Write test for Reactive controller

Testing ReactiveCrudRepository

The aim of this video is to write logic to perform joins between payment and user.

  • Write logic for join user and payment

  • Expose user and payment via endpoint

  • Use @PostConstruct to save pre-defined data set and test it

Performing Joins between Payment and User

The aim of this video is to add Spring MVC dependency to our Spring Boot app.

  • Add Spring MVC dependencies

  • Understand HTML generated by Spring

Adding Spring MVC to the Spring Boot App

The aim of this video is to create views for the payment and the user, also to add and understand myleaf dependency.

  • Add myleaf dependency

  • Add view in HTML page

  • Understand Spring myleaf

Creating Views for the Payment and User

The aim of this video is to create a payment view and MVC controller and exposing view for retrieving payments.

  • Create allPayments view

  • Create MVC controller

  • Expose payments via controller

Exposing View for Retrieving Payment via MVC Controller

The aim of this video is to expose view for creating new payment with the help of our MVC controller.

  • Create POST MVC endpoint

  • Create form in HTML

  • Add view for creating Payment

Exposing View for Creating New Payment via MVC Controller

The aim of this video is to test our MVC application using MockMVC construct.

  • Create integration test of MVC controller

  • Use MockMVC construct

  • Test POST and GET

Testing MVC Application Using MockMVC Construct

The aim of this video is to add web security configuration to protect our private endpoints.

  • Create SpringSecurityWebAppConfig

  • Protect secret endpoints

  • Allow other endpoints

Adding WebSecurity Configuration to Protect Private Endpoints

The aim of this video is to understand CORS security and expose static content securely.

  • Understand CORS security

  • Protect allowed origins

  • Allow origins to access static resources

Exposing Static Content Securely

The aim of this video is to write test for CORS protection and test security of payment private endpoints.

  • Write test for CORS protection

  • Test annotation config

  • Test Java config mechanism

Testing Security of Payment Private Endpoints

The aim of this video is to create and enable CSRF endpoints and add security for MVC endpoints.

  • Create CSRF secured endpoints

  • Configure SpringSecurityWebAppConfigMock

  • Enable CSRF token injection

Adding Security for MVC Endpoints

The aim of this video is to perform a security test on our app.

  • Write test for mockMVC with _csrf

  • Test that _csrf hidden token is included

  • Test with and without token

Performing Security Test on Your App

The aim of this video is to measure our REST endpoints and data access layer with Micrometer library.

  • Add MeterRegistry

  • Experiment with available metrics

  • Test various types of metrics

Measuring REST Endpoints and Data Access Layer

The aim of this video is to create a REST endpoint for exposing custom metrics.

  • Add Metrics in multiple places of the application

  • Create endpoint for exposing metrics

  • Test behavior of the app looking at metrics

Creating REST Endpoint for Exposing Custom Metrics

The aim of this video is to add and install Prometheus library and exposing metrics via it.

  • Add Prometheus support for the Spring app

  • Install Prometheus collector and Grafana

  • Expose custom metrics via Grafana

Exposing Metrics via Spring Prometheus Library

The aim of this video is to make our application reliable by adding custom health checks.

  • Add HealthCheck to the downstream services

  • Expose health checks endpoints

  • Start test

Making Application Reliable with Custom Health Checks

The aim of this video is to add and start Docker on localhost and create a Docker container with payment application.

  • Add Docker plugin to our project

  • Start Docker on localhost

  • Build Docker image with our app

Creating a Docker Container with Payment Application Cloud

The aim of this video is to create profile and deploy ready Docker container with application to Heroku Cloud.

  • Create profile

  • Deploy Spring service to Heroku

Deploy Ready Docker Container with Application to Heroku Cloud
Test Your Knowledge
5 questions
+ Troubleshooting Spring Boot 2.0
19 lectures 01:14:08

This video will give you an overview about the course.

Preview 03:07

A short introduction to Spring Boot 2 Actuator and its most important endpoints.

  • What is Actuator good for?

  • A basic configuration in application.properties

  • Show endpoints over the browser

Introducing Spring Boot Actuator

Configure a HelloWorld application with autoconfiguration.

  • Enable report by setting debug in application.properties

  • Add conditions to endpoints to be exposed

  • Show the results of the endpoint conditions

Debugging with Auto Configuration Report

Checking the health of a running system.

  • Check health over the endpoint

  • Implement a custom health check

  • Implement a custom information endpoint

Debugging with Custom Health Checks and Application Information

A short introduction to Micrometer and Prometheus as a metrics system.

  • Autoconfiguration of metrics

  • Implement a custom metric

  • Present the custom metric with Prometheus

Working with Custom Metrics

Showing how to set debug to the application and loggers.

  • Show the actuator loggers

  • Implement a simple log

  • Change the log level to debug during runtime

Playing with Debug Mode

A short introduction to the Log4j2 framework.

  • Add dependency to our pom-file

  • Configure Log4J

  • Add a logger to our application

Introducing Log4j, a Logging Framework

Showing possible ways of logging different levels for debug purposes.

  • Add custom levels

  • Add custom loggers

  • Add custom loggers to the application

Debugging with Logs

Showing how to manipulate log levels during runtime with Log4j in the background.

  • Best approaches for different loggers

  • Show possible manipulation ways with Log4j in the background

  • Show how to manipulate custom levels with JConsole

Manipulating Log Levels in Spring Boot

Differences between the build tools Maven, Gradle, and ant.

  • Features of Maven

  • Features of Gradle

  • Features of ant+ivy

A Brief Discussion of the Most Popular Build Tools

Typical problems related to Maven builds.

  • Set proxy for Maven

  • Troubleshoot corrupt jars

Troubleshooting Spring Boot Application with Maven

Typical problems related to Gradle builds.

  • Set proxy for Gradle

  • Description of build scan

Troubleshooting Spring Boot Application with Gradle

Information about debuggers.

  • Difference between troubleshooting and debugging

  • Main tasks of a debugger

Debuggers – a Friendly Beast!

Show how to use the debugger in Eclipse.

  • Overview of the most important shortcuts

  • Show how to use the debugger in a simple application

Working with Debugger in Eclipse

Show how to use the debugger in IntelliJ.

  • Overview of the most important shortcuts

  • Show how to use the debugger in a simple application

Working with Debugger in IntelliJ

Show how to deal with problems in an MVC application.

  • A short reminder of how MVC works

  • Define where the error comes from

  • Integrate exceptions in MVC

Troubleshooting a Spring MVC Application in Spring Boot

Show how to deal with problems in a REST application.

  • A short reminder of REST

  • Most common REST errors

  • Dealing with Exceptions

Troubleshooting a Spring REST Application in Spring Boot

Show how to deal with problems in an application with database access.

  • A short reminder of JPA

  • JPA-related errors

  • Show JPA application and problems

Troubleshooting a Spring Data Application in Spring Boot

Overview of the most common compilation errors.

  • Dependency injection failures and solutions

  • Other bean exceptions and solutions

  • Show bean overview in eclipse

Common Compilation Errors
Test Your Knowledge
5 questions
  • No prior knowledge of Spring Boot is assumed. However, a basic knowledge of Java and Spring would be beneficial.

Spring is one of the best frameworks in the market for developing web, enterprise, and cloud-ready applications and services. Spring Boot simplifies the building of complex apps dramatically by reducing the amount of boilerplate code, and by providing production-ready features and a simple deployment model. It is the fastest way to get a Spring application up-and-running with the fewest lines of code and the least configuration. If you're a Java developer who wants to build applications with Spring Boot 2, then go for this course.

This course is a step-by-step guide to building, testing, deploying, and monitoring your robust and scalable web applications using Spring MVC. You will learn to build microservices using Spring Boot 2 and see how microservices address common operational and infrastructural concerns. You will then build a payment system application from scratch using Spring Boot 2. You will also learn to secure your applications using Spring Security. Next, you will learn to create Docker containers to deploy your application into the cloud. Finally, you will leverage the additional features offered by Spring Boot Actuator to help you monitor and manage your applications and services when it's pushed to production.

Contents and Overview

This training program includes 3 complete courses, carefully chosen to give you the most comprehensive training possible.

The first course, Professional Spring Boot 2, transforms your skillset away from building single, large Java applications. You’ll benefit from understanding what microservices are, and the problems they pose for typical Java web services. You'll delve into the Spring Boot architecture and learn to use its components for your professional projects. Through practical examples, you'll build your own JSON RESTful web service, which is an essential tool for any Spring Boot developer. You'll also learn to use Mockito and JUnit to build an end-to-end integration testing suite. Lastly, you will use AWS and Docker to deploy your application to the cloud.

The second course, Hands-On Application Development with Spring Boot 2, provides a hands-on approach to building a payment system application from scratch using Spring Boot 2. You’ll begin by setting up Spring Boot together with Spring’s most powerful feature: Dependency Injection. You will then build a data access layer with Spring data and rework it to be highly performant using Spring data reactive. You’ll also learn about Spring rest and servlets and use it to expose resources via HTTP endpoints. Next, you’ll use Spring MVC to build an interface for the payment system. You’ll also be exposed to critical business metrics using MicroMeter library and Spring actuator with Prometheus library. Finally, you’ll learn to package your application into a Docker container and deploy your application into the cloud.

The third course, Troubleshooting Spring Boot 2.0, will start off by working with Spring Boot Actuator to debug and troubleshoot your application. Since logs can reveal a whole lot about your application and have been traditionally used to debug various types of software applications, this course will guide you through using the Log4j framework to keep a log of your application’s health and performance as you execute different operations. You’ll also get insights into debugging scenarios when you’re building a Spring Boot application using Maven and Gradle. Further on, you’ll work with debuggers available with popular IDEs to fix some common problems in your application. Toward the concluding parts of this course, you’ll learn the exception handling techniques in Spring applications and understand how to use them to troubleshoot when using Spring Boot.

By the end of the course, you will conquer the world of Java applications with Spring Boot 2 to develop, secure, deploy, and monitor your web applications from scratch.
Meet Your Expert(s):

We have the best work of the following esteemed author(s) to ensure that your learning journey is smooth:

  • Shalini Mittal has 8+ years of experience in learning and development. She has developed websites using technologies like HTML, CSS, Bootstrap and have trained student on technologies like Java 8, Java EE, Spring Boot, Laravel, Spring 5, Hibernate, Android, and many more.

  • TetraNoodle Technologies provides your business with an augmented executive service that prioritizes growth. We provide technology and CTO services that are cheaper, faster, and better informed than traditional CTOs. Our team has worked within the technology industry for over 45 years. We use the connections, experience, and knowledge we gained during this time to provide flexible solutions to your technology needs. We excel at scaling companies quickly by facilitating rapid technology implementation to propel you to the top of your industry.

  • Tomasz Lelek is a Software Engineer who programs mostly in Java and Scala. He has worked with Spark API and the ML API for the past five years and has production experience in processing petabytes of data. He is passionate about nearly everything associated with software development and believes that we should always try to consider different solutions and approaches before solving a problem. Recently, he was a speaker at conferences in Poland, Confitura and JDD (Java Developers Day), and the Krakow Scala User Group. He has also conducted a live coding session at Geecon Conference. He is a co-founder of initlearn, an e-learning platform that was built with the Java language.

  • Petra Simonis is a software developer with extensive expertise in Java, Spring, Spring Boot, C++, and other programming and scripting languages. Over the past 15 years, she has gained experience in the fields of multimedia retrieval, telecommunication, GIS services, and healthcare.

Who this course is for:
  • This course is for Java developers who want to build, test, and deploy production-ready applications with Spring Boot 2. Technical architects looking to learn how to employ Spring Boot in a cloud-native environment will also find this course useful.