About this project

Feign is an open-source Java library that makes writing HTTP clients easier by using a declarative, annotation-driven approach. Instead of manually constructing HTTP requests, developers define a Java interface with annotations that describe the HTTP method, URL template, headers, and body, and Feign generates the implementation at runtime. The library is inspired by Retrofit, JAX-RS 2.0, and WebSocket specifications. Its primary goal is to reduce the complexity of binding Java code to HTTP APIs uniformly, regardless of whether the API follows REST conventions. Key features include: - Annotation-based interface definitions using @RequestLine, @Param, @Headers, @QueryMap, @HeaderMap, and @Body - URI Template expression support following RFC 6570 Level 1, with limited Level 3 path-style expression support - Customizable encoders and decoders for JSON (Gson, Jackson, Moshi, Fastjson2), XML (JAXB, SAX), and SOAP - Pluggable HTTP client backends including OkHttp, Java 11 HTTP/2 Client, and Ribbon for service discovery - Circuit breaker integration via Hystrix - Logging integration with SLF4J - Configurable request options such as connect/read timeouts and redirect following - Support for multiple interface targets with dynamic URL resolution and request decoration - Custom parameter expansion via the Expander interface Feign 10.x and above are built on Java 8 and compatible with Java 9, 10, and 11. For JDK 6 compatibility, Feign 9.x is available. The roadmap outlines planned features including response caching, complete URI Template expression support (Levels 1-4), Logger and Retry API refactors, async execution via CompletableFuture, reactive execution via Reactive Streams, and additional circuit breaker support such as Resilience4J. Feign is available on Maven Central under the io.github.openfeign groupId. The project includes example clients for GitHub and Wikipedia APIs, and integrates with the Netflix Denominator project.