Spring Boot

Spring Boot and GraphQL Tutorial

Learn the core concepts of GraphQL and running an example Spring Boot application with GraphQL integrated for querying and updating the data.

Spring Boot Gradle Plugin

Spring Boot Gradle plugin provides support for Spring Boot applications using Gradle as the build automation tool that helps in dependency management and application packaging.

Springdoc OpenAPI: Swagger UI for Spring Boot REST APIs

Springdoc OpenAPI generates the OpenAPI 3 document and the Swagger UI page for a Spring Boot REST API from one starter dependency. Default URLs, springdoc.* properties, Swagger annotations, groups, security scheme and how to switch the docs off in production.

Caffeine Cache with Spring Boot

Learn about Caffeine Cache and how we can use Caffeine with Spring Boot. Learn to configure caching, add and evict cache entries with example

Spring Boot Tutorial

Learn Spring Boot with the following in-depth tutorials, covering from basic to advanced concepts such as packaging and monitoring.

Spring Boot Profiles

Learn about Spring profiles, @Profile, profile-specific beans and properties, profile groups and activating a certain profile during startup.

Accessing Properties in Spring Boot

Learn to use @PropertySource, @Value and @ConfigurationProperties annotations to register property files and inject configuration properties.

Kafka Multiple Consumers: Consumer Groups and Partitions

Kafka consumers with the same group.id split the partitions of a topic, while each consumer group gets every message. Real runs with 1 to 4 consumers, rebalance logs, assignment strategies, the new KIP-848 protocol and Spring Boot @KafkaListener concurrency.

Spring Boot DataSource Configuration with HikariCP Examples

Configure a DataSource in Spring Boot 4 with spring.datasource.url, username and password, and Spring Boot creates a HikariCP pool. Tested examples for pool tuning, DataSourceBuilder, a second DataSource, schema.sql and data.sql, and tests with H2 and Testcontainers.

Spring Boot Retry Example

Learn to use Spring retry module for implementing retry-based remote API invocations that can handle runtime exceptions or network failures.

Spring Batch Example with Spring Boot 4 (Spring Batch 6)

Spring Batch example with Spring Boot 4 and Spring Batch 6. We read a CSV file into an H2 table with a chunk-oriented step, run the job on startup and on demand with job parameters, skip bad lines, restart a failed run and test the job with JobOperatorTestUtils.

Spring Boot HATEOAS Links Example

In this Spring Boot HATEOAS example, we will learn to add HATEOAS (Hypertext as the Engine of Application State) links to resource representations returned from REST APIs in a Spring boot application. 1. What is HATEOAS? HATEOAS is one of the constraints of the REST architectural style first presented by …

Spring @ExceptionHandler vs @ControllerAdvice with Examples

Spring @ExceptionHandler methods handle exceptions in one controller, and the same methods in a @ControllerAdvice class handle them for every controller. Learn the difference, return ProblemDetail (RFC 9457) bodies, handle validation errors and @ResponseStatus, and test each handler with MockMvc on Spring Boot 4.

About Us

HowToDoInJava provides tutorials and how-to guides on Java and related technologies.

It also shares the best practices, algorithms & solutions and frequently asked interview questions.