How openfeign/feign works
Main Components
• Feign Builder (Central orchestrator)
• Contract Processor (Handles annotations)
• Request/Response Pipeline
• Method Handlers (Synchronous and Asynchronous)
b. Extension Points (Surrounding the core):
• Encoders/Decoders
• Clients
• Error Handlers
• Interceptors
• Metrics Collectors
• Loggers
Key Relationships
• Builder → Client Interface (creates)
• Client Interface → Request Template (generates)
• Request Template → HTTP Client (executes)
• Response → Decoder (processes)
• Error Response → Error Decoder (handles)
Component Details
For each major component, include:
• Supported formats (JSON, XML, Form data)
• Available implementations (Jackson, Gson, JAXB)
• Integration points (Spring, Metrics, Logging)
Request Flow
Request lifecycle:
Extension Mechanisms
Available extension points:
• Custom Encoders/Decoders
• Client Implementations
• Interceptors
• Error Handlers
• Metrics Collectors
Integration Points
Integration with:
• Spring Framework
• Metrics Systems (Dropwizard, Micrometer)
• Logging Frameworks (SLF4J)
• HTTP Clients (OkHttp, Apache HC)