These are chat archives for spring-cloud/spring-cloud

24th
Mar 2017
Niklas Herder
@herder
Mar 24 2017 14:41

Hi, apologies in advance if this is documented and I managed to miss it again:
I'm using three Feign Clients, two of which have a static server list and one is using Eureka. At least, that's what I want to do. But it seems that I can't configure per client whether to use Eureka or not, but it's Eureka for all or Eureka for none.
In RibbonEurekaAutoConfiguration I found this condition, which seems to imply that I can't disable Eureka selectively per Ribbon Feign client:

private static class OnRibbonAndEurekaEnabledCondition extends AllNestedConditions {

        public OnRibbonAndEurekaEnabledCondition() {
            super(ConfigurationPhase.REGISTER_BEAN);
        }

        @ConditionalOnClass(DiscoveryEnabledNIWSServerList.class)
        @ConditionalOnBean(SpringClientFactory.class)
        @ConditionalOnProperty(value = "ribbon.eureka.enabled", matchIfMissing = true)
        static class Defaults {}

        @ConditionalOnBean(EurekaClient.class)
        static class EurekaBeans {}
    }

Or is there some other option I can use to achieve this?

...and just after, I found this answer from @spencergibb : http://stackoverflow.com/a/38360581 :)
Thanks for impressive StackOverflow-FU! :bow: