Commit 1f2beba0 by Dave Syer

Add some @Conditionals to enable non-netflix apps to start

parent d715ec57
...@@ -41,6 +41,7 @@ import com.netflix.discovery.converters.XmlXStream; ...@@ -41,6 +41,7 @@ import com.netflix.discovery.converters.XmlXStream;
@Configuration @Configuration
@EnableConfigurationProperties @EnableConfigurationProperties
@ConditionalOnClass(EurekaClientConfig.class) @ConditionalOnClass(EurekaClientConfig.class)
@ConditionalOnBean(DiscoveryClient.class)
@ConditionalOnExpression("${eureka.client.enabled:true}") @ConditionalOnExpression("${eureka.client.enabled:true}")
public class EurekaClientAutoConfiguration { public class EurekaClientAutoConfiguration {
......
...@@ -6,6 +6,7 @@ import java.util.List; ...@@ -6,6 +6,7 @@ import java.util.List;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.AutoConfigureAfter; import org.springframework.boot.autoconfigure.AutoConfigureAfter;
import org.springframework.boot.autoconfigure.condition.ConditionalOnBean;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean; import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.cloud.client.loadbalancer.LoadBalancerClient; import org.springframework.cloud.client.loadbalancer.LoadBalancerClient;
import org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration; import org.springframework.cloud.netflix.eureka.EurekaClientAutoConfiguration;
...@@ -22,6 +23,7 @@ import com.netflix.loadbalancer.BaseLoadBalancer; ...@@ -22,6 +23,7 @@ import com.netflix.loadbalancer.BaseLoadBalancer;
* @author Dave Syer * @author Dave Syer
*/ */
@Configuration @Configuration
@ConditionalOnBean(SpringClientFactory.class)
@AutoConfigureAfter(EurekaClientAutoConfiguration.class) @AutoConfigureAfter(EurekaClientAutoConfiguration.class)
public class RibbonAutoConfiguration { public class RibbonAutoConfiguration {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment