Home

OpenFeign

OpenFeign is a Java library for declarative REST clients. It enables developers to define interfaces whose methods correspond to remote HTTP endpoints, with annotations specifying HTTP methods, paths, and parameters. At runtime, a dynamic proxy implements the interface and executes the HTTP requests, allowing client code to call remote services as if they were local objects. This approach reduces boilerplate and centralizes HTTP client configuration.

Key features include a declarative syntax via annotations, support for pluggable encoders and decoders (for JSON,

Architecture and usage: OpenFeign builds a dynamic proxy from a configuration that includes the target URL,

Context: OpenFeign is a community-maintained continuation of Netflix Feign, released under an open-source license. It is

XML,
and
other
formats),
and
a
pluggable
contract
that
interprets
interface
annotations.
OpenFeign
clients
can
be
customized
with
request
interceptors,
retry
behavior,
and
custom
error
handling.
It
also
supports
integration
with
other
ecosystems,
notably
Spring
Cloud
OpenFeign,
which
lets
developers
annotate
interfaces
with
Spring
MVC
annotations
and
@FeignClient
to
leverage
service
discovery
and
load
balancing.
encoder/decoder,
and
the
HTTP
client
implementation
(such
as
OkHttp
or
Apache
HttpClient).
When
a
method
is
invoked,
Feign
converts
the
method
call
into
an
HTTP
request,
sends
it,
and
decodes
the
response
into
the
declared
return
type.
widely
used
in
Java
microservices
architectures
to
simplify
cross-service
HTTP
communication
and
to
replace
more
boilerplate
REST
client
code.