All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.nepxion.discovery.plugin.strategy.gateway.configuration.GatewayStrategyAutoConfiguration Maven / Gradle / Ivy

There is a newer version: 6.22.0
Show newest version
package com.nepxion.discovery.plugin.strategy.gateway.configuration;

/**
 * 

Title: Nepxion Discovery

*

Description: Nepxion Discovery

*

Copyright: Copyright (c) 2017-2050

*

Company: Nepxion

* @author Haojun Ren * @version 1.0 */ import org.springframework.boot.autoconfigure.AutoConfigureBefore; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty; import org.springframework.cloud.netflix.ribbon.RibbonClientConfiguration; import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import com.nepxion.discovery.plugin.strategy.adapter.DefaultDiscoveryEnabledAdapter; import com.nepxion.discovery.plugin.strategy.adapter.DiscoveryEnabledAdapter; import com.nepxion.discovery.plugin.strategy.constant.StrategyConstant; import com.nepxion.discovery.plugin.strategy.gateway.filter.DefaultGatewayStrategyClearFilter; import com.nepxion.discovery.plugin.strategy.gateway.filter.DefaultGatewayStrategyRouteFilter; import com.nepxion.discovery.plugin.strategy.gateway.filter.GatewayStrategyClearFilter; import com.nepxion.discovery.plugin.strategy.gateway.filter.GatewayStrategyRouteFilter; import com.nepxion.discovery.plugin.strategy.gateway.tracer.DefaultGatewayStrategyTracer; import com.nepxion.discovery.plugin.strategy.gateway.tracer.GatewayStrategyTracer; import com.nepxion.discovery.plugin.strategy.gateway.wrapper.DefaultCallableWrapper; import com.nepxion.discovery.plugin.strategy.wrapper.CallableWrapper; @Configuration @AutoConfigureBefore(RibbonClientConfiguration.class) @ConditionalOnProperty(value = StrategyConstant.SPRING_APPLICATION_STRATEGY_CONTROL_ENABLED, matchIfMissing = true) public class GatewayStrategyAutoConfiguration { @Bean @ConditionalOnMissingBean public GatewayStrategyRouteFilter gatewayStrategyRouteFilter() { return new DefaultGatewayStrategyRouteFilter(); } @Bean @ConditionalOnMissingBean public GatewayStrategyClearFilter gatewayStrategyContextClearFilter() { return new DefaultGatewayStrategyClearFilter(); } @Bean @ConditionalOnMissingBean @ConditionalOnProperty(value = StrategyConstant.SPRING_APPLICATION_STRATEGY_TRACE_ENABLED, matchIfMissing = false) public GatewayStrategyTracer gatewayStrategyTracer() { return new DefaultGatewayStrategyTracer(); } @Bean @ConditionalOnMissingBean public DiscoveryEnabledAdapter discoveryEnabledAdapter() { return new DefaultDiscoveryEnabledAdapter(); } @Bean @ConditionalOnProperty(value = StrategyConstant.SPRING_APPLICATION_STRATEGY_HYSTRIX_THREADLOCAL_SUPPORTED, matchIfMissing = false) public CallableWrapper callableWrapper() { return new DefaultCallableWrapper(); } }




© 2015 - 2025 Weber Informatics LLC | Privacy Policy