ai-observability
Use when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor…
Use when calling external HTTP APIs from Spring Boot 3 / Spring Framework 6 with declarative HttpExchange interfaces. Covers manual proxy registration, RestClient versus WebClient, and timeout and error handling conventions.
Claude Code
$ npx -y skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients --agent claude-code
Codex
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a codex -y
Cursor
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a cursor -y
Gemini CLI
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a gemini-cli -y
GitHub Copilot
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a github-copilot -y
OpenCode
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a opencode -y
Windsurf
$ npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a windsurf -y
name: http-interface-clients description: > Use when calling external HTTP APIs from Spring Boot 3 / Spring Framework 6 with declarative HttpExchange interfaces. Covers manual proxy registration, RestClient versus WebClient, and timeout and error handling conventions.
Spring Framework 6 supports `@HttpExchange` interfaces, but Boot 3 does not provide Boot 4's `@ImportHttpServices` group auto-registration. Build the client adapter explicitly.
@HttpExchange("/orders")
interface OrderApiClient {
@GetExchange("/{id}")
OrderDto get(@PathVariable UUID id);
}
@Configuration
class ClientConfig {
@Bean
OrderApiClient orderApiClient(RestClient.Builder builder,
@Value("${clients.orders.base-url}") String baseUrl) {
RestClient client = builder.baseUrl(baseUrl).build();
HttpServiceProxyFactory factory =
HttpServiceProxyFactory.builderFor(RestClientAdapter.create(client)).build();
return factory.createClient(OrderApiClient.class);
}
}Use `WebClientAdapter` for reactive interfaces returning `Mono` or `Flux`. Configure base URLs, timeouts, authentication, and error translation in the client adapter layer rather than in controllers or domain services. Prefer one factory/configurer per external service.
Define an adapter policy before adding retry annotations. The companion [CatalogHttpClient](templates/CatalogHttpClient.java) implements the `CatalogRetryService.CatalogTransport` port from the resilience-retry skill and uses explicit JDK connect/read timeouts. It is a small imperative adapter example, not a reason to replace an existing HTTP interface or Boot-managed client.
| Failure | Example policy for an idempotent read | | --- | --- | | 401/403, malformed request, missing resource | Surface the domain-appropriate error; no blind retry | | 502/503/504, connect/read timeout | Translate to the bounded retry policy | | 429 with Retry-After | Schedule only within the caller's budget; not implemented by this example | | Cancellation or interruption | Propagate immediately, preserving interruption | | Invalid response body or TLS/certificate error | Diagnose; do not repeatedly retry by default |
For POST/payment calls, preserve the same idempotency key and request bytes across retries; a timeout does not prove the server did nothing. Never forward inbound Authorization to an arbitrary destination: configure credentials per trusted service. Do not allow an end user to choose the base URL. Avoid logging tokens or raw upstream error bodies.
Test the real client adapter against a stub HTTP server, including permanent status codes, transient-then-success responses, malformed bodies, delayed responses and cancellation. Keep connect, read, pool-acquisition and total deadlines distinct. When using WebClient, apply a total timeout around the whole retry sequence and avoid blocking the event loop.
See [Spring REST clients](https://docs.spring.io/spring-framework/reference/integration/rest-clients.html).
The repository fixture targets Boot 3.5.16 with Java 17/21 and checks the imperative catalog adapter against a local HTTP server; not every declarative group-registration option. Check the [coverage matrix](https://github.com/rrezartprebreza/spring-boot-skills/blob/main/verification/MATRIX.md) before treating another minor version or an illustrative snippet as verified.
Production-grade Claude Code and Codex skills for Spring Boot developers
Use when adding Spring AI-specific model observations, token usage, latency, externally configured cost attribution, advisor…
Use when versioning Spring MVC or WebFlux APIs in Spring Boot 3 / Spring Framework 6. Covers explicit URL, header, and media-type…
Use when introducing or correcting grouped Spring Boot configuration, typed property binding, validation, profiles or secret…
Use when packaging a Spring Boot 3 application as an OCI image or GraalVM native executable. Covers buildpacks, layered images,…
Use when evolving aggregate invariants, value objects or domain events in an existing DDD-style Spring Boot 3 application, or…
Use when implementing Kafka, RabbitMQ, Pulsar, or JMS producers and consumers in Spring Boot 3. Covers event contracts,…
You MUST use this before any creative work - creating features, building components, adding functionality, modifying behavior, or…
Ask which skill or flow fits your situation. A router over the skills in this repo.