Commit 8b7d6848 by Bertrand Renuart Committed by Spencer Gibb

use `com.netflix.loadbalancer.DummyPing` instead of `NoopPing`

use `com.netflix.loadbalancer.DummyPing` instead of `NoopPing` This eliminates the startup of another theadpool. fixes gh-1504
parent edb14e2a
...@@ -40,11 +40,11 @@ import com.netflix.client.RetryHandler; ...@@ -40,11 +40,11 @@ import com.netflix.client.RetryHandler;
import com.netflix.client.config.DefaultClientConfigImpl; import com.netflix.client.config.DefaultClientConfigImpl;
import com.netflix.client.config.IClientConfig; import com.netflix.client.config.IClientConfig;
import com.netflix.loadbalancer.ConfigurationBasedServerList; import com.netflix.loadbalancer.ConfigurationBasedServerList;
import com.netflix.loadbalancer.DummyPing;
import com.netflix.loadbalancer.ILoadBalancer; import com.netflix.loadbalancer.ILoadBalancer;
import com.netflix.loadbalancer.IPing; import com.netflix.loadbalancer.IPing;
import com.netflix.loadbalancer.IRule; import com.netflix.loadbalancer.IRule;
import com.netflix.loadbalancer.LoadBalancerBuilder; import com.netflix.loadbalancer.LoadBalancerBuilder;
import com.netflix.loadbalancer.NoOpPing;
import com.netflix.loadbalancer.Server; import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.ServerList; import com.netflix.loadbalancer.ServerList;
import com.netflix.loadbalancer.ServerListFilter; import com.netflix.loadbalancer.ServerListFilter;
...@@ -101,7 +101,7 @@ public class RibbonClientConfiguration { ...@@ -101,7 +101,7 @@ public class RibbonClientConfiguration {
if (this.propertiesFactory.isSet(IPing.class, name)) { if (this.propertiesFactory.isSet(IPing.class, name)) {
return this.propertiesFactory.get(IPing.class, config, name); return this.propertiesFactory.get(IPing.class, config, name);
} }
return new NoOpPing(); return new DummyPing();
} }
@Bean @Bean
......
...@@ -29,7 +29,7 @@ import org.springframework.test.annotation.DirtiesContext; ...@@ -29,7 +29,7 @@ import org.springframework.test.annotation.DirtiesContext;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner; import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;
import com.netflix.loadbalancer.ConfigurationBasedServerList; import com.netflix.loadbalancer.ConfigurationBasedServerList;
import com.netflix.loadbalancer.NoOpPing; import com.netflix.loadbalancer.DummyPing;
import com.netflix.loadbalancer.Server; import com.netflix.loadbalancer.Server;
import com.netflix.loadbalancer.ZoneAvoidanceRule; import com.netflix.loadbalancer.ZoneAvoidanceRule;
import com.netflix.loadbalancer.ZoneAwareLoadBalancer; import com.netflix.loadbalancer.ZoneAwareLoadBalancer;
...@@ -56,8 +56,8 @@ public class RibbonClientPreprocessorIntegrationTests { ...@@ -56,8 +56,8 @@ public class RibbonClientPreprocessorIntegrationTests {
} }
@Test @Test
public void pingDefaultsToNoOp() throws Exception { public void pingDefaultsToDummy() throws Exception {
NoOpPing.class.cast(getLoadBalancer().getPing()); DummyPing.class.cast(getLoadBalancer().getPing());
} }
@Test @Test
......
...@@ -69,9 +69,9 @@ public class RibbonClientPreprocessorPropertiesOverridesIntegrationTests { ...@@ -69,9 +69,9 @@ public class RibbonClientPreprocessorPropertiesOverridesIntegrationTests {
} }
@Test @Test
public void pingOverridesToDummy() throws Exception { public void pingOverridesToNoOp() throws Exception {
DummyPing.class.cast(getLoadBalancer("foo2").getPing()); NoOpPing.class.cast(getLoadBalancer("foo2").getPing());
NoOpPing.class.cast(getLoadBalancer("bar").getPing()); DummyPing.class.cast(getLoadBalancer("bar").getPing());
} }
@Test @Test
......
...@@ -29,7 +29,7 @@ foo: ...@@ -29,7 +29,7 @@ foo:
# for RibbonClientPreprocessorPropertiesOverridesIntegrationTests # for RibbonClientPreprocessorPropertiesOverridesIntegrationTests
foo2: foo2:
ribbon: ribbon:
NFLoadBalancerPingClassName: com.netflix.loadbalancer.DummyPing NFLoadBalancerPingClassName: com.netflix.loadbalancer.NoOpPing
NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule NFLoadBalancerRuleClassName: com.netflix.loadbalancer.RandomRule
NIWSServerListClassName: org.springframework.cloud.netflix.ribbon.test.TestServerList NIWSServerListClassName: org.springframework.cloud.netflix.ribbon.test.TestServerList
NIWSServerListFilterClassName: com.netflix.loadbalancer.ServerListSubsetFilter NIWSServerListFilterClassName: com.netflix.loadbalancer.ServerListSubsetFilter
......
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