-
Notifications
You must be signed in to change notification settings - Fork 30
io microsphere spring cloud openfeign autorefresh AutoRefreshCapability
Type: Class | Module: microsphere-spring-cloud-openfeign | Package: io.microsphere.spring.cloud.openfeign.autorefresh | Since: 0.0.1
AutoRefreshCapability is a class in the io.microsphere.spring.cloud.openfeign.autorefresh package of the microsphere-spring-cloud-openfeign module.
public class AutoRefreshCapability implements Capability, ApplicationContextAwareAuthor: 韩超
-
Introduced in:
0.0.1 -
Current Project Version:
0.2.18-SNAPSHOT
This component is tested and compatible with the following Java versions:
| Java Version | Status |
|---|---|
| Java 17 | ✅ Compatible |
| Java 21 | ✅ Compatible |
| Java 25 | ✅ Compatible |
AutoRefreshCapability capability = new AutoRefreshCapability(
clientProperties, contextFactory, componentRegistry);AutoRefreshCapability capability = new AutoRefreshCapability(props, factory, registry);
capability.setApplicationContext(applicationContext);Retryer original = new Retryer.Default();
Retryer enriched = capability.enrich(original);Contract original = new Contract.Default();
Contract enriched = capability.enrich(original);Decoder original = new Decoder.Default();
Decoder enriched = capability.enrich(original);Encoder original = new Encoder.Default();
Encoder enriched = capability.enrich(original);ErrorDecoder original = new ErrorDecoder.Default();
ErrorDecoder enriched = capability.enrich(original);RequestInterceptor original = template -> template.header("X-Custom", "value");
RequestInterceptor enriched = capability.enrich(original);QueryMapEncoder original = new QueryMapEncoder.Default();
QueryMapEncoder enriched = capability.enrich(original);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 io.microsphere.spring.cloud.openfeign.autorefresh.AutoRefreshCapability;| Method | Description |
|---|---|
setApplicationContext |
Constructs an AutoRefreshCapability with the required dependencies. |
enrich |
Enriches the given Retryer by wrapping it in a DecoratedRetryer
|
enrich |
Enriches the given Contract by wrapping it in a DecoratedContract
|
enrich |
Enriches the given Decoder by wrapping it in a DecoratedDecoder
|
enrich |
Enriches the given Encoder by wrapping it in a DecoratedEncoder
|
enrich |
Enriches the given ErrorDecoder by wrapping it in a DecoratedErrorDecoder
|
enrich |
Enriches the given RequestInterceptor by registering it in the |
enrich |
Enriches the given QueryMapEncoder by wrapping it in a DecoratedQueryMapEncoder
|
public void setApplicationContext(ApplicationContext applicationContext)Constructs an AutoRefreshCapability with the required dependencies.
Example Usage:
`AutoRefreshCapability capability = new AutoRefreshCapability(
clientProperties, contextFactory, componentRegistry);
`
public Retryer enrich(Retryer retryer)Enriches the given Retryer by wrapping it in a DecoratedRetryer
that supports auto-refresh on configuration changes.
Example Usage:
`Retryer original = new Retryer.Default(); Retryer enriched = capability.enrich(original); `
public Contract enrich(Contract contract)Enriches the given Contract by wrapping it in a DecoratedContract
that supports auto-refresh on configuration changes.
Example Usage:
`Contract original = new Contract.Default(); Contract enriched = capability.enrich(original); `
public Decoder enrich(Decoder decoder)Enriches the given Decoder by wrapping it in a DecoratedDecoder
that supports auto-refresh on configuration changes.
Example Usage:
`Decoder original = new Decoder.Default(); Decoder enriched = capability.enrich(original); `
public Encoder enrich(Encoder encoder)Enriches the given Encoder by wrapping it in a DecoratedEncoder
that supports auto-refresh on configuration changes.
Example Usage:
`Encoder original = new Encoder.Default(); Encoder enriched = capability.enrich(original); `
public ErrorDecoder enrich(ErrorDecoder decoder)Enriches the given ErrorDecoder by wrapping it in a DecoratedErrorDecoder
that supports auto-refresh on configuration changes.
Example Usage:
`ErrorDecoder original = new ErrorDecoder.Default(); ErrorDecoder enriched = capability.enrich(original); `
public RequestInterceptor enrich(RequestInterceptor requestInterceptor)Enriches the given RequestInterceptor by registering it in the
FeignComponentRegistry as part of a io.microsphere.spring.cloud.openfeign.components.CompositedRequestInterceptor.
Example Usage:
`RequestInterceptor original = template -> template.header("X-Custom", "value");
RequestInterceptor enriched = capability.enrich(original);
`
public QueryMapEncoder enrich(QueryMapEncoder queryMapEncoder)Enriches the given QueryMapEncoder by wrapping it in a DecoratedQueryMapEncoder
that supports auto-refresh on configuration changes.
Example Usage:
`QueryMapEncoder original = new QueryMapEncoder.Default(); QueryMapEncoder enriched = capability.enrich(original); `
This documentation was auto-generated from the source code of microsphere-spring-cloud.
spring-cloud-commons
- AbstractServiceRegistrationEndpoint
- CommonsPropertyConstants
- ConditionalOnAutoServiceRegistrationAvailable
- ConditionalOnAutoServiceRegistrationEnabled
- ConditionalOnBlockingDiscoveryAvailable
- ConditionalOnFeaturesAvailable
- ConditionalOnFeaturesEnabled
- ConditionalOnLoadBalancerEnabled
- ConditionalOnMultipleRegistrationEnabled
- ConditionalOnReactiveDiscoveryAvailable
- ConditionalOnUtilEnabled
- ConfigurationPropertyHasFeaturesAutoConfiguration
- DefaultRegistration
- DiscoveryClientAutoConfiguration
- DiscoveryClientConstants
- DiscoveryUtils
- EventPublishingRegistrationAspect
- FaultTolerancePropertyConstants
- InMemoryServiceRegistry
- InstanceConstants
- LoadBalancerUtils
- MultipleAutoServiceRegistration
- MultipleRegistration
- MultipleServiceRegistry
- ReactiveDiscoveryClientAdapter
- ReactiveDiscoveryClientAutoConfiguration
- RegistrationCustomizer
- RegistrationDeregisteredEvent
- RegistrationEvent
- RegistrationMetaData
- RegistrationPreDeregisteredEvent
- RegistrationPreRegisteredEvent
- RegistrationRegisteredEvent
- ServiceDeregistrationEndpoint
- ServiceInstanceUtils
- ServiceInstancesChangedEvent
- ServiceRegistrationEndpoint
- ServiceRegistrationEndpointAutoConfiguration
- ServiceRegistryAutoConfiguration
- SimpleAutoServiceRegistration
- SimpleAutoServiceRegistrationAutoConfiguration
- SimpleServiceRegistry
- SpecificationAutoConfiguration
- SpecificationBeanPostProcessor
- SpecificationCustomizer
- SpringCloudPropertyConstants
- TomcatDynamicConfigurationListener
- TomcatFaultToleranceAutoConfiguration
- UnionDiscoveryClient
- WebFluxServiceRegistryAutoConfiguration
- WebMvcServiceRegistryAutoConfiguration
- WebServiceRegistryAutoConfiguration
- WeightedRoundRobin
spring-cloud-openfeign
- AutoRefreshCapability
- AutoRefreshCapabilityCustomizer
- CompositedRequestInterceptor
- DecoratedContract
- DecoratedDecoder
- DecoratedEncoder
- DecoratedErrorDecoder
- DecoratedFeignComponent
- DecoratedQueryMapEncoder
- DecoratedRetryer
- EnableFeignAutoRefresh
- FeignAutoConfiguration
- FeignClientAutoRefreshAutoConfiguration
- FeignClientConfigurationChangedListener
- FeignComponentRegistry
- NoOpRequestInterceptor
- Refreshable