Spring HTTP Client

Configure RestClient with retry and circuit breaker patterns in Spring Boot.

1|Updated Mar 16, 2026
One-click install
npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill spring-http-client
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: Spring HTTP Client
Source: https://github.com/iceflower/opencode-agents-and-skills/tree/main/skills/spring-http-client
Command: npx skills add https://github.com/iceflower/opencode-agents-and-skills --skill spring-http-client

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

This Skill provides best practices and code examples for building resilient and maintainable HTTP clients within Spring Boot applications, addressing common challenges like timeouts, error handling, and retries.

Core Features & Use Cases

  • Declarative Client Setup: Configure RestClient with base URLs, headers, and custom request factories.
  • Usage Patterns: Demonstrates how to perform GET and POST requests, handle responses, and manage errors.
  • Resilience: Integrates Spring Retry and Resilience4j for implementing retry mechanisms and circuit breakers.
  • DTO Mapping: Shows how to map external API responses to internal domain models.

Quick Start

Configure your Spring Boot application to use the RestClient for external API calls.

Frequently Asked Questions about Spring HTTP Client

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I configure a Spring Boot RestClient for external API integration?

Configure a Spring Boot RestClient for external API integration by defining base URLs, default headers, and custom request factories. This declarative client setup provides a robust foundation for handling network requests and external service responses.

What is the best way to handle external API errors and timeouts in Spring Boot?

Handle external API errors and timeouts in Spring Boot by classifying HTTP error responses and configuring custom request factories. This fault-tolerant approach systematically manages request failures, connection delays, and unexpected external service responses.

How do I add a circuit breaker to my Spring Boot HTTP client?

Add a circuit breaker to your Spring Boot HTTP client by integrating Resilience4j. This mechanism prevents cascading system failures by tripping the circuit when external API interactions exceed configured error thresholds, ensuring overall application stability.

How do I implement retry strategies for Spring Boot API calls?

Implement retry strategies for Spring Boot API calls using Spring Retry. This mechanism automatically re-executes failed HTTP requests based on configured policies, satisfying requirements for building fault-tolerant and maintainable external API integrations.

Can I map external API responses to internal domain models using Spring RestClient?

You can map external API responses to internal domain models using Spring RestClient. This DTO mapping process translates external JSON payloads into internal Java objects, maintaining clean separation between your API integration layer and core business logic.