About http-interface-clients
A coding skill for building declarative HTTP interface clients in Spring Boot 3. It explains explicit proxy registration and client-layer configuration for teams integrating external services.
Key features
- 01Register @HttpExchange proxies as beans
- 02Use WebClientAdapter for reactive APIs
- 03Configure URLs, timeouts, and authentication
- 04Translate transport errors in the adapter
- 05Reuse singleton client proxies
Use cases
- 01Build typed clients for external services
- 02Expose reactive HTTP calls with Mono or Flux
- 03Keep remote URLs out of annotations
- 04Prevent transport errors leaking into domain code
Install
Copy the command and run it in a terminal.
npx skills add https:/ / github.com/ rrezartprebreza/ spring-boot-skills --skill http-interface-clientsAfter installing, type/http-interface-clientsin Claude Code to confirm it loaded.
Bundled files
References and scripts installed along with SKILL.md.
agents/openai.yamlexamples/bad-order-client.javagood-order-client.javaDetails
From the project READMEDeclarative HTTP Interface Clients (Boot 3)
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.
Gotchas
- Agent uses
@ImportHttpServices- that Boot 4 registration API is not available in Boot 3. - Agent adds
@Componentor an implementation to the interface - register the generated proxy as a bean. - Agent uses
RestClientforMonoorFlux- useWebClientAdapterfor reactive return types. - Agent hard-codes remote hosts in annotations - keep URLs in configuration.
- Agent lets transport errors leak through the domain - translate them in the client adapter.
- Agent creates a new client per request - configure and reuse a singleton proxy.