Skip to content

io microsphere spring cloud openfeign autoconfigure FeignClientAutoRefreshAutoConfiguration

github-actions[bot] edited this page Mar 26, 2026 · 12 revisions

FeignClientAutoRefreshAutoConfiguration

Type: Class | Module: microsphere-spring-cloud-openfeign | Package: io.microsphere.spring.cloud.openfeign.autoconfigure | Since: 0.0.1

Source: microsphere-spring-cloud-openfeign/src/main/java/io/microsphere/spring/cloud/openfeign/autoconfigure/FeignClientAutoRefreshAutoConfiguration.java

Overview

The Auto-Configuration class for EnableFeignAutoRefresh

Declaration

public class FeignClientAutoRefreshAutoConfiguration

Author: 韩超

Version Information

  • Introduced in: 0.0.1
  • Current Project Version: 0.2.5-SNAPSHOT

Version Compatibility

This component is tested and compatible with the following Java versions:

Java Version Status
Java 17 ✅ Compatible
Java 21 ✅ Compatible
Java 25 ✅ Compatible

Examples

Method Examples

addDefaultRequestInterceptorCustomizer

// Automatically registered as a Spring bean; customizes every Feign builder
FeignBuilderCustomizer customizer = addDefaultRequestInterceptorCustomizer();

onApplicationReadyEvent

// Invoked automatically by the Spring event system on application ready
onApplicationReadyEvent(applicationReadyEvent);

feignClientRegistry

// Automatically registered as a Spring bean
FeignComponentRegistry registry = feignClientRegistry(clientProperties, beanFactory);

feignClientSpecificationPostProcessor

// Automatically registered as a Spring bean
FeignClientSpecificationPostProcessor processor = feignClientSpecificationPostProcessor();

Usage

Maven Dependency

Add the following dependency to your pom.xml:

<dependency>
    <groupId>io.github.microsphere-projects</groupId>
    <artifactId>microsphere-spring-cloud-openfeign</artifactId>
    <version>${microsphere-spring-cloud.version}</version>
</dependency>

Tip: Use the BOM (microsphere-spring-cloud-dependencies) for consistent version management. See the Getting Started guide.

Import

import io.microsphere.spring.cloud.openfeign.autoconfigure.FeignClientAutoRefreshAutoConfiguration;

API Reference

Public Methods

Method Description
addDefaultRequestInterceptorCustomizer Creates a FeignBuilderCustomizer that adds the NoOpRequestInterceptor
onApplicationReadyEvent Handles the ApplicationReadyEvent to register the
feignClientRegistry Make sure the FeignClientConfigurationChangedListener is registered after the ConfigurationPropertiesRebinder
feignClientSpecificationPostProcessor Creates the FeignClientSpecificationPostProcessor bean that injects

Method Details

addDefaultRequestInterceptorCustomizer

public FeignBuilderCustomizer addDefaultRequestInterceptorCustomizer()

Creates a FeignBuilderCustomizer that adds the NoOpRequestInterceptor as a default request interceptor to every Feign client builder.

Example Usage:

`// Automatically registered as a Spring bean; customizes every Feign builder
FeignBuilderCustomizer customizer = addDefaultRequestInterceptorCustomizer();
`

onApplicationReadyEvent

public void onApplicationReadyEvent(ApplicationReadyEvent event)

Handles the ApplicationReadyEvent to register the FeignClientConfigurationChangedListener after the application is fully initialized.

Example Usage:

`// Invoked automatically by the Spring event system on application ready
onApplicationReadyEvent(applicationReadyEvent);
`

feignClientRegistry

public FeignComponentRegistry feignClientRegistry(FeignClientProperties clientProperties, BeanFactory beanFactory)

Make sure the FeignClientConfigurationChangedListener is registered after the ConfigurationPropertiesRebinder / registerFeignClientConfigurationChangedListener(event); }

/** Creates the FeignComponentRegistry bean that tracks decorated Feign components and supports auto-refresh when configuration properties change.

Example Usage:

`// Automatically registered as a Spring bean
FeignComponentRegistry registry = feignClientRegistry(clientProperties, beanFactory);
`

feignClientSpecificationPostProcessor

public FeignClientSpecificationPostProcessor feignClientSpecificationPostProcessor()

Creates the FeignClientSpecificationPostProcessor bean that injects the io.microsphere.spring.cloud.openfeign.autorefresh.AutoRefreshCapability into default Feign client specifications.

Example Usage:

`// Automatically registered as a Spring bean
FeignClientSpecificationPostProcessor processor = feignClientSpecificationPostProcessor();
`

See Also

  • EnableFeignAutoRefresh

This documentation was auto-generated from the source code of microsphere-spring-cloud.

Home

spring-cloud-commons

spring-cloud-openfeign

Clone this wiki locally