Skip to content

Commit

Permalink
fix #162
Browse files Browse the repository at this point in the history
  • Loading branch information
cstongwei authored and zilongTong committed Jun 9, 2022
1 parent 1a99320 commit b9cf294
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.gateway.config.LoadBalancerProperties;
import org.springframework.cloud.gateway.filter.LoadBalancerClientFilter;
import org.springframework.cloud.gateway.filter.ReactiveLoadBalancerClientFilter;
import org.springframework.cloud.loadbalancer.support.LoadBalancerClientFactory;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
Expand All @@ -42,15 +43,9 @@ public FemasGatewayGovernanceFilter femasGatewayFilter() {
return new FemasGatewayGovernanceFilter();
}

// @Bean
// @ConditionalOnMissingBean({FemasReactiveLoadBalancerClientFilter.class})
// public FemasReactiveLoadBalancerClientFilter reactiveLoadBalancerClientFilter(DiscoveryServerConverter converter, LoadBalancerClientFactory clientFactory, LoadBalancerProperties properties) {
// return new FemasReactiveLoadBalancerClientFilter(converter, clientFactory, properties);
// }

@Override
public Object postProcessBeforeInitialization(Object bean, String beanName) {
if(bean instanceof LoadBalancerClientFilter){
if(bean instanceof LoadBalancerClientFilter || bean instanceof ReactiveLoadBalancerClientFilter){
DiscoveryServerConverter converter = context.getBean(DiscoveryServerConverter.class);
LoadBalancerClientFactory clientFactory= context.getBean(LoadBalancerClientFactory.class);
LoadBalancerProperties properties =context.getBean(LoadBalancerProperties.class);
Expand Down

0 comments on commit b9cf294

Please sign in to comment.