- name
SKILL.md
技能文件保留在发布者的仓库中。
在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a cursor -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a claude-code -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a codex -y在终端中粘贴复制的命令。它会把这个 SKILL.md 安装到对应的智能体中。
npx skills add rrezartprebreza/spring-boot-skills --skill http-interface-clients -a grok -y在 Grok Bot 聊天中发送复制的消息。Bot 会从 GitHub 获取这个 SKILL.md,并添加到你所有 Bot 共享的技能中。
Install this skill: https://github.com/rrezartprebreza/spring-boot-skills/tree/HEAD/skills/spring-boot-3/http-interface-clients来自发布者
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 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.
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.
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 before treating another minor version or an illustrative snippet as verified.
@ImportHttpServices - that Boot 4 registration API is not available in Boot 3.@Component or an implementation to the interface - register the generated proxy as a bean.RestClient for Mono or Flux - use WebClientAdapter for reactive return types.>
---name: http-interface-clientsdescription: >---# skills/spring-boot-3/http-interface-clients/SKILL.md常见问题
从发布者处下载 skills/spring-boot-3/http-interface-clients/SKILL.md,或复制路径后打开仓库。PlugMCP 只收录该技能,不托管文件。
发布者将它存放在 https://github.com/rrezartprebreza/spring-boot-skills。
Claude、Cursor、Codex 和 Grok Build 可以读取你从发布者仓库添加的 SKILL.md。在聊天中发送技能的 GitHub 文件夹链接,Grok Bot 就会安装它。