Enterprise Java with Spring Boot

Josh Long
Broadcom
7 hours, 7 minutes CC
Enterprise Java with Spring Boot

Course Description

Learn how the world’s leading companies build Java applications. Start by rapid prototyping with start.spring.io and build production-ready backends with Spring Data and REST APIs. Then grow into advanced topics like microservices, Docker, GraalVM, and AI-powered features. Architect modern, scalable Java applications with confidence!

This course and others like it are available as part of our Frontend Masters video subscription.

Preview
Close

Course Details

Published: July 24, 2025

Rating

5

Learn Straight from the Experts Who Shape the Modern Web

Your Path to Senior Developer and Beyond
  • 200+ In-depth courses
  • 18 Learning Paths
  • Industry Leading Experts
  • Live Interactive Workshops

Table of Contents

Introduction

Section Duration: 4 minutes

Development Environment Setup

Section Duration: 1 hour
  • Spring Boot Speed Run
    Josh demonstrates how fast a full-featured Java Spring app can be scaffolded using start.spring.io. In a matter of minutes, Josh creates the project, connects to a data source, and spins up a web server to display data returned from the API endpoint. This isn't an example that needs to be followed, but a speed-run-style demonstration of Spring.
  • Managing Java VM Distributions
    Josh introduces SDKMAN for installing and managing Java distributions on your computer and within a project. The .sdkmanrc configuration file can specify the Java VM used in a project, and SDKMAN will automatically switch to that version when the project directory is entered.
  • Spring Boot Setup & Code Formatting
    Josh revisits start.spring.io and explains and highlights the ergonomics of creating a new project. Many IDEs, such as IntelliJ, VS Code, and Eclipse, also rely on start.spring.io. The spring-javaformat code formatter is also discussed.
  • Build & Run Spring Boot with Docker
    Josh walks through running a Spring app inside a Docker container. Through Docker virtualization, binaries for other operating systems can be generated with minimal configuration. Data sources can also be quickly created within a container, allowing for easier connection configuration.
  • Understanding the Project Structure
    Josh breaks down the project structure generated from start.spring.io and explains the dependencies in the pom.xml file. Josh also demonstrates how to use the application.properties file to customize the behavior of the Postgres database. The Dev Tools are included in the demo project to highlight how to quickly see updates to the application in the browser.
  • Configuration
    Josh continues customizing the application through application.properties and overrides default values through environment variables. This lesson also discusses password manager integration.

Java & Spring Basics

Section Duration: 47 minutes
  • Java Language Review
    Josh reviews some new additions to the Java programming language, including pattern matching, smart switch statements, and records/sealed types. These features make it easier to manage data directly inside the language.
  • Java Development Best Practices
    Josh discusses some general Java/Spring best practices. These include RAII (resource acquisition is initialization), dependency injection, portable service abstraction, and aspect-oriented programming. These topics are not Spring-specific, but create better-architected Spring applications.
  • Spring Features
    Josh introduces the Spring framework and walks through some ergonomic features, such as dependency injection, component scanning, and life cycles. With life cycles, the InitializeBean and DisposableBean interfaces provide afterPropertySet and destroy methods for validating the state of the object before use and cleaning up any dependencies prior to its disposal.
  • Spring Boot Features
    Josh transitions to Spring Boot, which provides the same expressive configuration as the Spring framework, but with useful defaults that eliminate unnecessary boilerplate. Dynamic autoconfigurations are discussed. Environmental properties and Spring's event API is also demonstrated in this lesson.

Pet Clinic App

Section Duration: 41 minutes
  • Spring Data & Migrations
    Josh explores strategies for persisting data in SQL stores with plain JDBC using Spring Data. A migrations directory is created and database migrations are added to ensure modifications are repeatable/reversible and data stores are not edited directly through the application.
  • Fetching Data Models
    Josh demonstrates how to use the @Repository, which acts primarily as a marker interface to capture the types needed to work. For example, the CrudRepository provides CRUD functionality for the managed entity class. Spring Data can also generate the underlying queries given the function signature of the CRUD methods defined in the class.
  • One-to-Many Relationships
    Josh highlights how quickly Spring Data picks up on many-to-many relationships. A database migration is added to insert dogs into the dog table. A new Dog record is created and displayed in the console alongside the Person data.
  • Spring Batch
    Josh introduces Spring Batch, which helps with ETL processes (extract, transform, and load). A Spring Batch job is created, and data is loaded from a CSV file and written to a SQL database. The chunk size used in the batch processing should be an amount of data that can be handled in memory.

Web Programming

Section Duration: 59 minutes
  • Building an HTTP Client
    Josh scaffolds a new Spring project for building an HTTP Client. The client loads data from a remote JSON endpoint. A declarative client technique is introduced to make adding additional REST clients to the application easier. Additional features are added through composable annotations.
  • GET & POST Requests Controller
    Josh builds an HTTP controller to handle GET and POST requests within the HTTP client.
  • Spring HATEAOS
    Josh introduces HATEAOS, hypermedia as the engine of application state. This pattern provides link metadata along with the payload so the rest client does not require prior knowledge of interacting with an application or server beyond a generic understanding of hypermedia.
  • MVC with Thymeleaf
    Josh demonstrates the capabilities of Thymeleaf, a Java template engine for processing and creating HTML, XML, JavaScript, CSS, and text. A controller is added to the application, and the `mvc` endpoint output is mapped to a `users.html` server-side template.
  • GraphQL
    Josh codes a GraphQL example to highlight how Spring handles GraphQL endpoints flexibly. A GraphQL controller is added to the application. QueryMapping, SchemaMapping, and BatchMapping annotations are added to explore how to handle different use cases. These mappings can be switched out on the server without affecting the client APIs.
  • gRPC
    Josh adds a gRPC endpoint to the Spring application. gRPC is a high-performance, open-source RPC framework initially developed by Google. The API is based on Protocol Buffers.
  • HTTP Client with Database Exercise
    Josh guides students through creating a basic HTTP client to review all the topics covered in the Web Programming section. The client utilizes the Spring Web and Spring JDBC starters to communicate with a Postgres database in a Docker container.

Spring in Production

Section Duration: 25 minutes
  • Enabling Actuator Endpoints
    Josh introduces some production-related topics, beginning with the Spring Actuator. The Spring Actuator provides API endpoints for system information like health, custom server properties, recent git history, configuration properties, and other server-related metrics. These endpoints would typically be served on another port or private domain for internal monitoring.
  • Building for Production with GraalVM
    Josh builds a native image using GraalVM. Once the image is built and run, any application or environment properties can be provided externally through the terminal as environment variables or through an application.properties file in the target directory.
  • Building a Docker Image
    Josh builds a containerized version of the application using Docker, which allows it to be built for other platforms. Application properties are passed to the Docker image on startup through the Docker CLI.

Messaging & Integration

Section Duration: 44 minutes
  • Spring for Kafka
    Josh discusses the messaging integrations with Spring. A Kafka messaging broker is started in a Docker container. The initial Spring application is scaffolded, and the ApplicationRunner is coded with the injected Kafka template. A DogAdoptionRequest payload is stubbed out, and the event listener is configured.
  • Serializing & Deserializing JSON
    Josh adds JSON support to the Kafka messaging application. The serialization support is provided through producer and consumer application properties. Pulsar and RabbitMQ support is also discussed in this lesson.
  • Enterprise Integration Patterns
    Josh discusses the integration patterns enterprise applications face as they interface with distributed systems. Most integration styles fall into four categories: file transfer, shared databases, remote procedure calls, and messaging. The Enterprise Integration Patterns book is mentioned and offered as a recommended reading for enterprise architects.
  • Building an Order Integration Flow
    Josh develops an integration flow using a purchase ordering system as an example. The inbound adaptor is sent through a series of transforms to move file data from a string format to JSON, and finally, to Java domain objects which are logged to the console.
  • Multi-Channel Integration Flows
    Josh adds MessageChannels to the application, serving as the logical pipe through which the messages flow. This allows the application to have multiple sources for the inbound flow. One source is the original file system flow. The other is a post request.

Architecting for Modularity

Section Duration: 53 minutes
  • Modularity in Spring
    Josh emphasises the importance of modularity in Spring applications. The separation of concerns is core to Java, and modularity at scale keeps applications maintainable. A pet adoption app is scaffolded to highlight modularity techniques. Initial classes for Dog and Vet objects are created.
  • Event-Based Integration
    Josh explains that too many concerns and dependencies inside a controller can lead to undue complexity. Asynchronous, event-based integration is introduced as a solution. Event-based integrations decouple the producer and consumer of the event because all the necessary details are contained in the message sent in the event.
  • Asynchronous Event Publishers
    Josh refactors the application so that an event is published when a dog is adopted. A listener is added to the Dogtor module to decouple it from the adoption service. The outbox pattern is introduced to further decouple the two systems. This pattern provides an asynchronous messaging approach to reconcile transactional systems.
  • Testing for Modularity
    Josh introduces the @Externalized annotation, allowing messages to be published across multiple JVMs. The testing features of Spring Modulith are also highlighted, including the ability to print the modules and their dependencies. The Documenter is used to generate a UML diagram of these dependencies.
  • Microservices with Spring Cloud
    Josh creates a microservice registry with the Eureka module from Spring Cloud Discovery. Any discoverable service will appear in the service registry, which can be interacted with programmatically, enabling features like client-side load balancing.
  • Building a Microservice Client App
    Josh builds a REST client to consume the services. The client will utilize the load-balanced builder. This means the load balancing will occur in the client as it's accessing the downstream services.
  • Spring Cloud Gateway Microproxy
    Josh refactors the microservice to use a proxy. The Gateway Proxy module behaves similarly to Apache mod_rewrite or Nginx. Requests from the client are proxied through the load balancer, which eliminates CORS or other network-related issues.

Security

Section Duration: 45 minutes

Spring & AI

Section Duration: 42 minutes
  • Spring AI
    Josh introduces Spring AI and discusses how Java developers can leverage their knowledge of building robust APIs and backend applications as they integrate with AI systems. A Spring application is scaffolded with Spring AI, support for MCPs, and a Postgres vector database.
  • Building an AI Assistant
    Josh creates an AI assistant to help with dog adoption. The assistant uses the OpenAI API to process requests. Chat messages are managed in memory, so the full history can be passed along in the context window with each request.
  • PGVector Store
    Josh explains the importance of vector databases when working with AI. These databases offer features like similarity search and enable efficient storage and searching of vector data. Josh uses the OpenAI API to generate a vector store of the adoption database. The AI agent is updated to use the vector store when returning results.
  • Tool Calling
    Josh builds a scheduling tool for the AI adoption application to highlight Spring AI's tool calling capabilities. The assistant will look at the tools available and determine which one to call, given the context of the request from the user.
  • Model Context Protocol
    Josh extracts the scheduler tool from the application and puts it into an MCP server. The application is then refactored to use the MPC server for its tool calling.

Wrapping Up

Section Duration: 1 minute

Learn Straight from the Experts Who Shape the Modern Web

  • In-depth Courses
  • Industry Leading Experts
  • Learning Paths
  • Live Interactive Workshops
Get Unlimited Access Now