I'm finding this question incomplete without proper usage example of how things should be set up.

Since op did not mention target language I'm feeling like to share Kotlin setup that works in my case:

build.gradle.kts

implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.playtika.reactivefeign:feign-reactor-core:3.2.1")
implementation("com.playtika.reactivefeign:feign-reactor-spring-configuration:3.2.1")
implementation("com.playtika.reactivefeign:feign-reactor-webclient:3.2.1")

Config.kt

@Configuration
@EnableWebFlux
@EnableReactiveFeignClients
class Config {
}

MyFeignClient.kt

@Component
@ReactiveFeignClient(
        url = "\${package.service.my-service-url}",
        name = "client"
)
interface MyFeignClient {
    @GetMapping(value = ["/my/url?my_param={my_value}"], consumes = ["application/json"])
    fun getValues(
            @PathVariable(name = "my_value") myValue: String?,
        ): Mono<MyEntity?>?
}

Then here goes code in some service class:

val myClient: MyFeignClient = WebReactiveFeign.builder<MyFeignClient>()
        .contract(ReactiveContract(SpringMvcContract()))
        .target(MyFeignClient::class.java, "http://example.com")
// feel free to add .block() to get unpacked value or just chain your logic further
val response = myClient.getValues(param)
Answer from im_infamous on Stack Overflow
🌐
GitHub
github.com › PlaytikaOSS › feign-reactive › blob › develop › feign-reactor-spring-configuration › README.md
feign-reactive/feign-reactor-spring-configuration/README.md at develop · PlaytikaOSS/feign-reactive
Thus all interfaces annotated with @ReactiveFeignClient annotation will be instantiated and configured as Spring beans · You should specify name attribute in this annotation. Feign client bean will be registered with the name of name + "ReactiveFeignClient" if you had not specified qualifier attribute.
Author: PlaytikaOSS
Top answer
1 of 2
10

I'm finding this question incomplete without proper usage example of how things should be set up.

Since op did not mention target language I'm feeling like to share Kotlin setup that works in my case:

build.gradle.kts

implementation("org.springframework.boot:spring-boot-starter-webflux")
implementation("com.playtika.reactivefeign:feign-reactor-core:3.2.1")
implementation("com.playtika.reactivefeign:feign-reactor-spring-configuration:3.2.1")
implementation("com.playtika.reactivefeign:feign-reactor-webclient:3.2.1")

Config.kt

@Configuration
@EnableWebFlux
@EnableReactiveFeignClients
class Config {
}

MyFeignClient.kt

@Component
@ReactiveFeignClient(
        url = "\${package.service.my-service-url}",
        name = "client"
)
interface MyFeignClient {
    @GetMapping(value = ["/my/url?my_param={my_value}"], consumes = ["application/json"])
    fun getValues(
            @PathVariable(name = "my_value") myValue: String?,
        ): Mono<MyEntity?>?
}

Then here goes code in some service class:

val myClient: MyFeignClient = WebReactiveFeign.builder<MyFeignClient>()
        .contract(ReactiveContract(SpringMvcContract()))
        .target(MyFeignClient::class.java, "http://example.com")
// feel free to add .block() to get unpacked value or just chain your logic further
val response = myClient.getValues(param)
2 of 2
6

You can check this library: https://github.com/Playtika/feign-reactive

implementation of Feign on Spring WebClient. Brings you the best of two worlds together: concise syntax of Feign to write client-side API on fast, asynchronous and non-blocking HTTP client of Spring WebClient

🌐
GitHub
github.com › PlaytikaOSS › feign-reactive
GitHub - PlaytikaOSS/feign-reactive: Reactive Feign client inspired by https://github.com/OpenFeign project · GitHub
You can enable auto-configuration of reactive Feign clients as Spring beans just by adding feign-reactor-spring-configuration module to classpath.
Starred by 636 users
Forked by 131 users
Languages: Java
🌐
Spring
docs.spring.io › spring-cloud-openfeign › docs › current › reference › html
Spring Cloud OpenFeign
Spring Cloud OpenFeign does not provide the following beans by default for feign, but still looks up beans of these types from the application context to create the feign client: ... A bean of Retryer.NEVER_RETRY with the type Retryer is created by default, which will disable retrying. Notice this retrying behavior is different from the Feign default one, where it will automatically retry IOExceptions, treating them as transient network related exceptions, and any RetryableException thrown from an ErrorDecoder. Creating a bean of one of those type and placing it in a @FeignClient configuration (such as FooConfiguration above) allows you to override each one of the beans described.
🌐
Stack Overflow
stackoverflow.com › questions › 79568668 › how-to-configure-reactive-feigns-underlying-httpclient-in-spring-boot
How to configure Reactive Feign's underlying HttpClient in spring boot? - Stack Overflow
Define a custom WebClient.Builder bean with a NettyClientHttpConnector using HttpClient.create().resolver(spec -> spec.retryTcp(true)), and Reactive Feign will auto-use it.
🌐
Vinsguru
vinsguru.com › spring-webclient-with-feign
Spring WebClient With Feign | Vinsguru
February 5, 2022 - Spring auto-configuration scans for @ReactiveFeignClient annotation and creates the beans automatically for us. movie.service.url can be injected via property file. In this case, I keep the value as shown below in the property file. ... We have some abstract methods for performing various CRUD operations. This is enough and Feign will take care of the REST (!).
🌐
Stack Overflow
stackoverflow.com › questions › tagged › reactive-feign-client
Newest 'reactive-feign-client' Questions - Stack Overflow
June 18, 2024 - I want to make a http call from gateway to my microservice. I have tried to add feign configuration: @Configuration @EnableReactiveFeignClients(basePackages = ... ... I have a Spring Boot application that uses the feign-reactive library by PlaytikaOSS to create non-blocking HTTP clients using ...
🌐
GitHub
github.com › PlaytikaOSS › feign-reactive › blob › develop › README.md
feign-reactive/README.md at develop · PlaytikaOSS/feign-reactive
You can enable auto-configuration of reactive Feign clients as Spring beans just by adding feign-reactor-spring-configuration module to classpath.
Find elsewhere
🌐
GitHub
github.com › hzlulu › feign-reactive
GitHub - hzlulu/feign-reactive: Reactive Feign client inspired by https://github.com/OpenFeign project · GitHub
You can enable auto-configuration of reactive Feign clients as Spring beans just by adding feign-reactor-spring-configuration module to classpath.
Author: hzlulu
🌐
DevGenius
blog.devgenius.io › how-to-build-high-performance-api-client-using-reactive-feign-bae4b5053d12
How to Build High Performance API Client Using Reactive Feign | by Gavin F. | Dev Genius
January 1, 2022 - The API client sends a request to the endpoint and it holds the thread until a response is received. As a result, the whole process is blocked until a response is received. Without a doubt, it is critical to apply non-blocking in the end-to-end ...
🌐
GitHub
github.com › kptfh › feign-reactive
GitHub - kptfh/feign-reactive: Reactive Feign client based on Spring WebFlux · GitHub
/* Create instance of your API */ IcecreamServiceApi client = Rx2ReactiveFeign .builder() .target(IcecreamServiceApi.class, "http://www.icecreame.com") /* Execute nonblocking requests */ Flowable<Flavor> flavors = icecreamApi.getAvailableFlavors(); Observable<Mixin> mixins = icecreamApi.getAvailableMixins(); <repositories> <repository> <id>bintray-kptfh-feign-reactive</id> <name>bintray</name> <url>https://dl.bintray.com/kptfh/feign-reactive</url> </repository> </repositories> ...
Starred by 168 users
Forked by 167 users
Languages: Java
🌐
Spring Cloud
cloud.spring.io › spring-cloud-openfeign › reference › html
Spring Cloud OpenFeign
Until that is done, we recommend using feign-reactive for Spring WebClient support. Depending on how you are using your Feign clients you may see initialization errors when starting your application. To work around this problem you can use an ObjectProvider when autowiring your client. @Autowired ObjectProvider<TestFeginClient> testFeginClient; To see the list of all Sleuth related configuration properties please check the Appendix page.
Top answer
1 of 2
1

Looks like you are trying to use feign-reactive (https://github.com/Playtika/feign-reactive) to implement your REST clients. I am also using it for one of my projects and it looks like this library does not have an out-of-the-box way to specify basic auth credentials. At least no way to do this declaratively. So I didn't find a better way to do this than to abandon the auto-configuration via @ReactiveFeignClient and start configuring reactive feign clients manually. This way you can manually add "Authorization" header to all outgoing requests. So, provided this client definition:

public interface FeingClient {

    @PostMapping("/api/students/special")
    public Flux<Student> getAllStudents(@RequestBody Flux<SubjectStudent> lista);

}

Add the following configuration class to your Spring context, replacing username, password and service-url with your own data:

@Configuration
public class FeignClientConfiguration {
    
    @Bean
    FeignClient feignClient() {
        WebReactiveFeign
            .<FeignClient>builder()
            .addRequestInterceptor(request -> {
                request.headers().put(
                    "Authorization", 
                     Collections.singletonList(
                        "Basic " + Base64.getEncoder().encodeToString( 
                            "username:password".getBytes(StandardCharsets.ISO_8859_1))));
                return request;
            })
            .target(FeignClient.class, "service-url");
    }
}

Note, that this API for manual configurftion of reactive feign clients can differ between different versions of the reactive-feign library. Also note that this approach has a major drawback - if you start creating beans for your feign clients manually you lose the main advantage of Feign - ability to write REST-clients declaratively with just a few lines of code. E.g. if you want to use the above client with some sort of client-side load-balancing mechanism, like Ribbon/Eureka or Ribbon/Kubernetes, you will also need to configure that manually.

2 of 2
1

You can use a direct interceptor:

@Configuration
class FeignClientConfiguration {
    @Bean
    fun reactiveHttpRequestInterceptor(): ReactiveHttpRequestInterceptor {
        return ReactiveHttpRequestInterceptor { request: ReactiveHttpRequest ->
            request.headers()["Authorization"] = //insert data from SecurityContextHolder;
            Mono.just(request)
        }
    }
}
🌐
Stack Overflow
stackoverflow.com › questions › tagged › reactive-feign-client
Highest scored 'reactive-feign-client' questions - Stack Overflow
Hi I'm implementing a spring boot application with spring version 3.0.2 and using feign-reactor-webclient:3.2.6 for API client. Every time I start application it shown error: Parameter 0 of ... ... I have JHipster gateway and microservice. I want to make a http call from gateway to my microservice. I have tried to add feign configuration: @Configuration @EnableReactiveFeignClients(basePackages = ... ... I have a Spring Boot application that uses the feign-reactive library by PlaytikaOSS to create non-blocking HTTP clients using Project Reactor.
🌐
Baeldung
baeldung.com › home › spring › spring cloud › introduction to spring cloud openfeign
Introduction to Spring Cloud OpenFeign | Baeldung
February 19, 2026 - feign: client: config: default: connectTimeout: 5000 readTimeout: 5000 loggerLevel: basic · With this configuration, we’re setting the timeouts to five seconds and the logger level to basic for each declared client in the application.
🌐
GitHub
github.com › PlaytikaOSS › feign-reactive › issues › 437
setting some properties under reactive.feign.client.config.default.options completely replace any other option set by Configuration class in @ReactiveFeignClient · Issue #437 · PlaytikaOSS/feign-reactive
February 25, 2022 - reactive: feign: client: config: default: options: connectTimeoutMillis: 10000 readTimeoutMillis: 60000 writeTimeoutMillis: 60000 · The timeouts were correctly applied and into the development envrironment (with no proxy) everything work fine. Unfortunately once we set the timeouts into the application.yml, in the other environments (were we have to use a proxy to reach the services) the proxy problem reappeared. It seems the configuration class by code is completely ignored once the key reactive.feign.client.config.default.options is present within the application.yml file.
Author: PlaytikaOSS
🌐
Better Programming
betterprogramming.pub › feign-reactive-my-preferred-solution-for-rest-api-consumption-5d79a283b24f
Feign Reactive — My Preferred Solution for REST API Consumption | by Wenqi Glantz | Better Programming
October 24, 2022 - OpenFeign is a popular framework ... an external service in microservices architecture. Feign Reactive is the implementation of Feign on Spring WebClient....
🌐
GitHub
github.com › jnopnop › feign-reactive
GitHub - jnopnop/feign-reactive: Reactive Feign client based on Spring WebFlux · GitHub
feign-reactor-jetty : experimental Reactive Jetty client based implementation of reactor Feign (doesn't depend on feign-reactor-webclient).