Skip to content

Latest commit

 

History

History
55 lines (34 loc) · 1.33 KB

feign_usage.md

File metadata and controls

55 lines (34 loc) · 1.33 KB

RequestLog Feign Configuration

Common Configuration (Logging, Persistence, Retry, etc.)

Maven Dependency

<dependency>
    <groupId>io.github.requestlog</groupId>
    <artifactId>request-log-feign-starter</artifactId>
    <version>${last stable version}</version>
</dependency>

Enhance Feign

Feign adopts an AOP approach and is automatically enhanced after introducing the dependency.

If you want to temporarily disable it, configure request-log.feign.disable=true.


Note: FeignClient must use service discovery. If a URL is specified, it will not be intercepted by AOP.


Usage

import io.github.requestlog.feign.clients.TestFeignClient; // Feign for testing, can be found in the test package

// Original Request
ResponseModel responseModel = testFeignClient.get();

// Wrap the request using LogContext
ResponseModel responseModel = LogContext.log().execute(() -> {
    return testFeignClient.get();
});

Retry

Feign retry is not supported; you can use other HttpClient retry mechanisms

If rewriting request information is involved during retry, refer to Common Usage - Retry