Files
llm-wiki/raw/official-docs/outbound-openfeign-declarative-client.md
T

110 lines
9.7 KiB
Markdown

---
title: OpenFeign / Spring Cloud OpenFeign — declarative HTTP client (대안 비교)
source_type: official-doc
status: raw
confidence: high
url: https://spring.io/projects/spring-cloud-openfeign
archive_url:
related_branches: [feature-outbound-http-client-baseline, feature-integration-adapter-templates]
related_projects: [ca-tmpl]
tags: [ca-outbound-http, openfeign, feign, declarative, alternative]
created: 2026-05-22
last_reviewed: 2026-05-27
---
# OpenFeign / Spring Cloud OpenFeign — declarative HTTP client
> Layer: `raw/official-docs/` — Spring Cloud OpenFeign project page + Spring Cloud OpenFeign reference + OpenFeign GitHub README 의 declarative client 정의/특성 발췌. ca-tmpl outbound Group G-C 의 대안 4 (OpenFeign 배제 근거).
## Parent / 활용 branch (필수)
| Branch | 이 자료가 정당화하는 결정 |
|---|---|
| [[raw/branch-notes/feature-outbound-http-client-baseline]] | outbound HTTP baseline 선정 시 OpenFeign (declarative) vs RestClient (explicit) 비교에서 OpenFeign 배제 근거 |
| [[raw/branch-notes/feature-integration-adapter-templates]] | adapter template 표준화에서 declarative interface 패턴이 baseline 적합하지 않은 사유 (mapping/timeout/error 변환 책임 모호) |
## 컨텍스트
ca-tmpl outbound 대안 **OpenFeign** 의 위치 정리. declarative client 가 baseline 에 적합하지 않은 이유.
## 출처 / Source
- Spring Cloud OpenFeign 프로젝트 페이지: https://spring.io/projects/spring-cloud-openfeign
- Spring Cloud OpenFeign reference: https://docs.spring.io/spring-cloud-openfeign/docs/current/reference/html/
- OpenFeign GitHub: https://github.com/OpenFeign/feign
- 아카이브 URL: (미수집)
- 저자 / 조직: Spring Cloud (Pivotal/VMware/Broadcom) + OpenFeign community
- 발행일: rolling docs (Spring Cloud OpenFeign reference current)
- 마지막 확인일: 2026-05-27
## 핵심 인용 / Key quotes (verbatim)
> [§Spring Cloud OpenFeign project page] "Declarative REST Client: Feign creates a dynamic implementation of an interface decorated with JAX-RS or Spring MVC annotations"
> [§Spring Cloud OpenFeign reference — Declarative REST Client: Feign] "Feign is a declarative web service client. It makes writing web service clients easier. To use Feign create an interface and annotate it."
> [§Spring Cloud OpenFeign reference — Declarative REST Client: Feign] "It has pluggable annotation support including Feign annotations and JAX-RS annotations. Feign also supports pluggable encoders and decoders."
> [§Spring Cloud OpenFeign reference — Declarative REST Client: Feign] "Spring Cloud adds support for Spring MVC annotations and for using the same `HttpMessageConverters` used by default in Spring Web."
> [§OpenFeign GitHub README] "Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket."
> [§OpenFeign GitHub README] "Feign simplifies the process of writing Java HTTP clients"
> [§OpenFeign GitHub README] "Feign has several aspects that can be customized."
## Claims Extracted / 추출된 주장
| Claim ID | Claim (이 자료가 직접 말하는 것) | Evidence quote | Strength | Applies to | Does not prove |
|---|---|---|---|---|---|
| OPENFEIGN-C1 | Spring Cloud OpenFeign 은 interface 에 annotation 을 붙여 dynamic 구현을 생성하는 **declarative REST client** | [§project page] "Declarative REST Client: Feign creates a dynamic implementation of an interface decorated with JAX-RS or Spring MVC annotations" | `official-vendor-doc` | Spring Cloud OpenFeign 도입 후 interface 기반 client | 동적 endpoint (런타임 URL 결정) 가 자연스럽다는 뜻 아님 — interface contract 가 컴파일 타임에 고정 |
| OPENFEIGN-C2 | Feign 의 사용 패턴: interface 생성 후 annotation. Annotation 어휘는 JAX-RS / Feign / Spring MVC 가 pluggable | [§reference — Declarative REST Client: Feign] "Feign is a declarative web service client. ... To use Feign create an interface and annotate it." + "It has pluggable annotation support including Feign annotations and JAX-RS annotations." | `official-vendor-doc` | Feign + Spring Cloud OpenFeign 모듈 동시 사용 | RestClient 의 `RequestInterceptor` / `ResponseErrorHandler` 와 동일한 hook chain 을 보장한다는 뜻은 아님 |
| OPENFEIGN-C3 | Spring Cloud OpenFeign 은 Spring MVC annotation 및 Spring Web default `HttpMessageConverters` 통합을 추가 제공 | [§reference] "Spring Cloud adds support for Spring MVC annotations and for using the same `HttpMessageConverters` used by default in Spring Web." | `official-vendor-doc` | Spring Cloud OpenFeign starter 사용 시 | Spring MVC annotation 시맨틱이 server-side 와 100% 동일하다는 뜻은 아님 — 일부 mapping 동작은 client-side 한정 |
| OPENFEIGN-C4 | Feign 은 Retrofit / JAX-RS 2.0 / WebSocket 에 영감을 받은 Java-to-HTTP client binder 이며, 여러 측면 (decoder/encoder/interceptor/contract) 이 customizable | [§GitHub README] "Feign is a Java to HTTP client binder inspired by Retrofit, JAXRS-2.0, and WebSocket." + "Feign has several aspects that can be customized." | `official-vendor-doc` | OpenFeign core library | customization 의 정확한 hook 이름이 RestClient/WebClient 와 일대일 대응한다는 뜻 아님 |
| OPENFEIGN-C5 | Spring Cloud OpenFeign 이 "maintenance-only / feature complete" 상태라는 명시는 본 WebFetch 시점 (2026-05-27) 의 spring.io 프로젝트 페이지 및 current reference HTML 에서 **확인 불가** — 본 메모/이전 인용은 별도 출처 확인 필요 | (negative finding — WebFetch 2회 모두 "No such notice appears") | `needs-confirmation` | Spring Cloud OpenFeign 향후 로드맵 판단 시 | 이 부정 확인은 maintenance-only 가 **거짓** 이라는 뜻이 아니라, **본 페이지에서는 미확인** 이라는 뜻 |
## Usage Boundaries / 적용 경계
- **이 자료가 직접 증명하는 것**:
- `OPENFEIGN-C1` ~ `C4`: declarative 패턴, interface + annotation, JAX-RS / Spring MVC annotation pluggable, `HttpMessageConverters` 통합, customizable hooks 의 존재
- **이 자료가 증명하지 않는 것**:
- Spring Cloud OpenFeign 의 "maintenance-only / feature complete" 상태 — 본 페이지 인용으로 보장 안 됨 (`OPENFEIGN-C5`). 별도 출처 확인 필요 (Spring blog announcement, GitHub repo status, 또는 spring-projects/spring-cloud-openfeign README)
- Resilience4j `FeignDecorator` 의 존재 — 본 페이지에 없음 (Resilience4j 공식 문서에서 확인 필요)
- Spring 6.1+ `@HttpExchange` + `HttpServiceProxyFactory.builderFor(restClient)` 가 declarative + explicit 책임을 동시에 제공한다는 비교 — 본 페이지 미언급 (별도 Spring Framework reference 페이지 확인 필요)
- reflection 비용 / startup time / GraalVM native image 호환성 — 본 페이지 미언급
- **내 프로젝트에 적용하려면 추가 확인이 필요한 것**:
- ca-tmpl 에서 OpenFeign 배제 결정의 1차 근거가 "maintenance-only" 라면 → 별도 출처로 보강 필수 (현재는 needs-confirmation)
- "OpenFeign interface 가 SDK 형태와 모호한 경계" 라는 ca-tmpl 결정 사항은 해석. Feign customization hook 의 명세에서 직접 도출되지 않음
- 동적 endpoint (런타임 URL 결정) 의 "어색함" 은 인용에서 직접 증명되지 않음 — RequestLine 또는 `URI` parameter 사용 가능 여부 별도 검증
## 메모 / Notes (내 프로젝트 해석)
> 본 섹션은 자료 직접 인용 아님. ca-tmpl 결정 컨텍스트 해석.
- 장점:
- interface annotation 기반 — controller 코드 ↔ client 코드 대칭. 사용처 발견성 좋음.
- encoder/decoder/interceptor 가 명시적 hook 으로 분리 (`OPENFEIGN-C4` 의 customizable 항목).
- Resilience4j 통합 첫 시민 (별도 출처 검증 필요). CircuitBreaker/Retry decorator 를 interface 단위로 attach.
- 단점 (ca-tmpl 입장):
- Spring Cloud OpenFeign 이 **maintenance-only** 라는 일반적인 관측 — 본 WebFetch 로는 미확인 (`OPENFEIGN-C5`). 별도 출처 보강 필요.
- 동적 endpoint (런타임에 URL 결정) 처리 어색 (해석, 미검증).
- reflection 비용 — startup time 에 영향 (해석, 미검증). Native image / GraalVM 호환성 추가 작업 필요.
- 인터페이스 contract 가 사실상 SDK 형태가 됨 — provider SDK bypassing 금지 (ca-tmpl 결정) 와 모호한 경계 (해석).
- ca-tmpl 결정 정당성 (재구성):
- declarative client 는 편하지만 **baseline 은 explicit RestClient** 가 매핑/타임아웃/에러 변환 책임을 명확히 함.
- Spring 6.1+ 의 `@HttpExchange` + `HttpServiceProxyFactory.builderFor(restClient)` 조합이면 RestClient 기반으로 declarative + explicit 책임을 동시에 얻을 수 있음 → **OpenFeign 도입 정당성이 더 약해짐** (이 비교는 별도 Spring Framework reference 페이지에서 검증 필요).
- 시사점: ca-tmpl 가 OpenFeign 을 채택하지 않은 것은 **maintenance status 가정 + `@HttpExchange` 대체 가능성 가정** 때문. 두 가정 모두 본 raw 만으로는 증명되지 않으며 별도 보강 필요.
## Related / 관련
- 같은 주제 다른 official-doc:
- [[raw/official-docs/outbound-spring-restclient-baseline]] — RestClient baseline 결정 근거
- [[raw/official-docs/outbound-webclient-vs-restclient-spring]] — sync vs reactive baseline 비교
- [[raw/official-docs/outbound-resilience4j-vs-spring-retry]] — retry/circuit breaker library 비교
- 같은 주제 company-tech-blog:
- [[raw/company-tech-blogs/outbound-stripe-rate-limit-retry-engineering]] — Stripe retry/idempotency 사례
- 인용하는 branch:
- [[raw/branch-notes/feature-outbound-http-client-baseline]]
- [[raw/branch-notes/feature-integration-adapter-templates]]
- 인용하는 wiki: (미작성)