Spring Boot RestClient Error Handling
Are you handling errors in the Spring RestClient the right way? In this video, I'll walk you through best practices for error handling, from using the default RestClient builder to global exception handlers, custom exceptions, and the brand-new retry support built into Spring Framework 7.
We'll build a REST client from scratch that talks to HTTPBin.org, set up a default status handler to catch HTTP errors centrally, create custom exceptions with Problem Detail responses (RFC 9457), extract REST client configuration into a reusable bean, and finish by adding automatic retries with exponential …
Watch on YouTube ↗
(saves to browser)
Chapters (10)
Intro & Project Setup
1:30
Exploring HTTPBin.org as a Test API
2:45
Tip #1: Use the Default RestClient Builder
4:30
Making GET Requests & Default Error Behavior
5:45
Suppressing Default Exceptions with onStatus
6:30
Why Per-Method Status Checking Doesn't Scale
7:15
Using defaultStatusHandler on the Builder
8:00
Tip #2: Global Exception Handler with @RestControllerAdvice
9:15
Returning ProblemDetail (RFC 9457) Responses
10:30
Extracting RestClient Config into a @Bean
DeepCamp AI