Przejdź do treści
Biblioteka skilli
Programowanie · Budowanie i kod

http-interface-clients

/http-interface-clients

Pomaga wywoływać zewnętrzne API ze Spring Boot 3 i Spring Framework 6 przez deklaratywne interfejsy HttpExchange: ręczna rejestracja proxy, RestClient lub WebClient oraz timeouty i obsługa błędów.

Licencja
MIT
Ostatnia zmiana repozytorium
22.10.2026

Ocena i bezpieczeństwo

100/ 100Klasa: dobry
Format25 / 25
Frontmatter z nazwą i opisem, poprawna nazwa, opis do 1024 znaków, nazwa zgodna z folderem.
Odkrywalność25 / 25
Opis mówi, kiedy użyć skilla, ma sensowną długość i jest w 3. osobie.
Treść35 / 35
Co najmniej 150 słów i do 500 linii, nagłówki, listy kroków, przykłady albo kod.
Higiena15 / 15
Bez zaślepek typu TODO, bez ścieżek Windows, z licencją.
Ryzykobrak sygnałów w skanie
Pliki w paczce
4
Skrypty
2
Komentarze HTML
0
Adresy URL w SKILL.md
0
Przestarzałość

Brak sygnałów. Repozytorium zmienione 22.10.2026, bez odwołań do wycofanych modeli i API.

Licencja

MIT, otwarta: można używać i zmieniać, z zachowaniem informacji o autorze.

Co sprawdzić przed instalacją
  • 2 skrypty w paczce. Przejrzyj je przed instalacją, bo Claude może je uruchomić.

Skrypty: examples/bad-order-client.java, examples/good-order-client.java

Co robi i kiedy

Pomaga wywoływać zewnętrzne API ze Spring Boot 3 i Spring Framework 6 przez deklaratywne interfejsy HttpExchange: ręczna rejestracja proxy, RestClient lub WebClient oraz timeouty i obsługa błędów.

Oryginalny opis (EN)

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.

Jak działa

  1. Gotchas
Sekcje z nagłówków SKILL.md, w oryginale · 39 linii, 194 słów
Podgląd SKILL.md
---
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.
---

# Declarative 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.

```java
@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 `@Component` or an implementation to the interface - register the generated proxy as a bean.
- Agent uses `RestClient` for `Mono` or `Flux` - use `WebClientAdapter` for 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.
Pliki w paczce (4)
  • SKILL.md 2 KB
  • agents/openai.yaml 1 KB
  • examples/bad-order-client.java 1 KB
  • examples/good-order-client.java 1 KB

Wersje

RepozytoriumWynikLicencja
Ta strona · rrezartprebreza/spring-boot-skills100MIT
rrezartprebreza/spring-boot-skills100MIT

Migawka bazy z 13.11.2026 · wersja paczki 3ad62f2c57cf (skrót SHA-256 całej paczki)

Pobrania w ostatnich 30 dniach: 0 · ranking

Zgłoś problem z tym skillem: szkodliwa treść, błędny opis albo prośba autora o usunięcie.

Podobne skille

  • 100spring-testing-http-client
    Testuje kod wywołujący zewnętrzne API w Spring Boot: RestClient, klienty HTTP, MockRestServiceServer i błędy odpowiedzi.
  • 100spring-cloud-openfeign
    Wspiera deklaratywnego klienta HTTP Spring Cloud OpenFeign dla komunikacji mikroserwisów: @FeignClient, obsługa błędów, interceptory i integracja z circuit breakerem.
  • 100spring-web
    Wspiera Spring Web MVC w Spring Boot 3.x: RestClient, WebClient, ResponseEntity, interceptory, negocjacja treści, przesyłanie plików, odpowiedzi strumieniowe i własne resolvery argumentów.
  • 100spring-boot-web-api
    Wspiera implementację REST API w Spring Boot 4: kontrolery, walidacja żądań, ProblemDetail (RFC 9457), wersjonowanie API, WebFlux, klienty @HttpExchange, Jackson 3 i CORS.
  • 95restclient-migration
    Migruje RestTemplate na RestClient w Spring Boot 3.2 i nowszych: przejście na płynne API, konfiguracja beanów, migracje GET, POST i DELETE, obsługa błędów i ParameterizedTypeReference.
  • 100spring-boot-expert
    Wspiera pracę z Spring Boot, Spring Framework, API REST i mikroserwisami w Javie.

Uwagi i zgłoszenia

Wiadomość trafi do Bartosza Sokolińskiego. Adres e-mail jest potrzebny tylko do odpowiedzi. Szczegóły w polityce prywatności.