diff --git a/multi/multi_spring-cloud-ribbon.html b/multi/multi_spring-cloud-ribbon.html
index 64a08e563..78e9d4638 100644
--- a/multi/multi_spring-cloud-ribbon.html
+++ b/multi/multi_spring-cloud-ribbon.html
@@ -32,54 +32,7 @@ separate, non-overlapping package, or specify the packages to scan
explicitly in the @ComponentScan).
Spring Cloud Netflix provides the following beans by default for ribbon
(BeanType beanName: ClassName):
IClientConfig ribbonClientConfig: DefaultClientConfigImplIRule ribbonRule: ZoneAvoidanceRuleIPing ribbonPing: DummyPingServerList<Server> ribbonServerList: ConfigurationBasedServerListServerListFilter<Server> ribbonServerListFilter: ZonePreferenceServerListFilterILoadBalancer ribbonLoadBalancer: ZoneAwareLoadBalancerServerListUpdater ribbonServerListUpdater: PollingServerListUpdaterCreating a bean of one of those type and placing it in a @RibbonClient
configuration (such as FooConfiguration above) allows you to override each
-one of the beans described. Example:
@Configuration -protected static class FooConfiguration { - @Bean - public ZonePreferenceServerListFilter serverListFilter() { - ZonePreferenceServerListFilter filter = new ZonePreferenceServerListFilter(); - filter.setZone("myTestZone"); - return filter; - } - - @Bean - public IPing ribbonPing() { - return new PingUrl(); - } -}
This replaces the NoOpPing with PingUrl and provides a custom serverListFilter
A default configuration can be provided for all Ribbon Clients using the @RibbonClients annotation and registering a default configuration as shown in the following example:
@RibbonClients(defaultConfiguration = DefaultRibbonConfig.class) -public class RibbonClientDefaultConfigurationTestsConfig { - - public static class BazServiceList extends ConfigurationBasedServerList { - public BazServiceList(IClientConfig config) { - super.initWithNiwsConfig(config); - } - } -} - -@Configuration -class DefaultRibbonConfig { - - @Bean - public IRule ribbonRule() { - return new BestAvailableRule(); - } - - @Bean - public IPing ribbonPing() { - return new PingUrl(); - } - - @Bean - public ServerList<Server> ribbonServerList(IClientConfig config) { - return new RibbonClientDefaultConfigurationTestsConfig.BazServiceList(config); - } - - @Bean - public ServerListSubsetFilter serverListFilter() { - ServerListSubsetFilter filter = new ServerListSubsetFilter(); - return filter; - } - -}
Starting with version 1.2.0, Spring Cloud Netflix now supports customizing Ribbon clients using properties to be compatible with the Ribbon documentation.
This allows you to change behavior at start up time in different environments.
The supported properties are listed below and should be prefixed by <clientName>.ribbon.:
NFLoadBalancerClassName: should implement ILoadBalancerNFLoadBalancerRuleClassName: should implement IRuleNFLoadBalancerPingClassName: should implement IPingNIWSServerListClassName: should implement ServerListNIWSServerListFilterClassName should implement ServerListFilter![]() | Note |
|---|---|
Classes defined in these properties have precedence over beans defined using |
To set the IRule for a service name users you could set the following:
application.yml. +one of the beans described. Example:
Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonClientsPreprocessorIntegrationTests.java[tags=sample_override_ribbon_config,indent=0]This replaces the NoOpPing with PingUrl and provides a custom serverListFilter
A default configuration can be provided for all Ribbon Clients using the @RibbonClients annotation and registering a default configuration as shown in the following example:
Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/test/RibbonClientDefaultConfigurationTestsConfig.java[tags=sample_default_ribbon_config,indent=0]Starting with version 1.2.0, Spring Cloud Netflix now supports customizing Ribbon clients using properties to be compatible with the Ribbon documentation.
This allows you to change behavior at start up time in different environments.
The supported properties are listed below and should be prefixed by <clientName>.ribbon.:
NFLoadBalancerClassName: should implement ILoadBalancerNFLoadBalancerRuleClassName: should implement IRuleNFLoadBalancerPingClassName: should implement IPingNIWSServerListClassName: should implement ServerListNIWSServerListFilterClassName should implement ServerListFilter![]() | Note |
|---|---|
Classes defined in these properties have precedence over beans defined using |
To set the IRule for a service name users you could set the following:
application.yml.
users:
ribbon:
NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList
diff --git a/single/spring-cloud-netflix.html b/single/spring-cloud-netflix.html
index d001c0386..cdfc17cfa 100644
--- a/single/spring-cloud-netflix.html
+++ b/single/spring-cloud-netflix.html
@@ -386,54 +386,7 @@ separate, non-overlapping package, or specify the packages to scan
explicitly in the @ComponentScan).Spring Cloud Netflix provides the following beans by default for ribbon
(BeanType beanName: ClassName):
IClientConfig ribbonClientConfig: DefaultClientConfigImplIRule ribbonRule: ZoneAvoidanceRuleIPing ribbonPing: DummyPingServerList<Server> ribbonServerList: ConfigurationBasedServerListServerListFilter<Server> ribbonServerListFilter: ZonePreferenceServerListFilterILoadBalancer ribbonLoadBalancer: ZoneAwareLoadBalancerServerListUpdater ribbonServerListUpdater: PollingServerListUpdaterCreating a bean of one of those type and placing it in a @RibbonClient
configuration (such as FooConfiguration above) allows you to override each
-one of the beans described. Example:
@Configuration -protected static class FooConfiguration { - @Bean - public ZonePreferenceServerListFilter serverListFilter() { - ZonePreferenceServerListFilter filter = new ZonePreferenceServerListFilter(); - filter.setZone("myTestZone"); - return filter; - } - - @Bean - public IPing ribbonPing() { - return new PingUrl(); - } -}
This replaces the NoOpPing with PingUrl and provides a custom serverListFilter
A default configuration can be provided for all Ribbon Clients using the @RibbonClients annotation and registering a default configuration as shown in the following example:
@RibbonClients(defaultConfiguration = DefaultRibbonConfig.class) -public class RibbonClientDefaultConfigurationTestsConfig { - - public static class BazServiceList extends ConfigurationBasedServerList { - public BazServiceList(IClientConfig config) { - super.initWithNiwsConfig(config); - } - } -} - -@Configuration -class DefaultRibbonConfig { - - @Bean - public IRule ribbonRule() { - return new BestAvailableRule(); - } - - @Bean - public IPing ribbonPing() { - return new PingUrl(); - } - - @Bean - public ServerList<Server> ribbonServerList(IClientConfig config) { - return new RibbonClientDefaultConfigurationTestsConfig.BazServiceList(config); - } - - @Bean - public ServerListSubsetFilter serverListFilter() { - ServerListSubsetFilter filter = new ServerListSubsetFilter(); - return filter; - } - -}
Starting with version 1.2.0, Spring Cloud Netflix now supports customizing Ribbon clients using properties to be compatible with the Ribbon documentation.
This allows you to change behavior at start up time in different environments.
The supported properties are listed below and should be prefixed by <clientName>.ribbon.:
NFLoadBalancerClassName: should implement ILoadBalancerNFLoadBalancerRuleClassName: should implement IRuleNFLoadBalancerPingClassName: should implement IPingNIWSServerListClassName: should implement ServerListNIWSServerListFilterClassName should implement ServerListFilter![]() | Note |
|---|---|
Classes defined in these properties have precedence over beans defined using |
To set the IRule for a service name users you could set the following:
application.yml. +one of the beans described. Example:
Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonClientsPreprocessorIntegrationTests.java[tags=sample_override_ribbon_config,indent=0]This replaces the NoOpPing with PingUrl and provides a custom serverListFilter
A default configuration can be provided for all Ribbon Clients using the @RibbonClients annotation and registering a default configuration as shown in the following example:
Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/test/RibbonClientDefaultConfigurationTestsConfig.java[tags=sample_default_ribbon_config,indent=0]Starting with version 1.2.0, Spring Cloud Netflix now supports customizing Ribbon clients using properties to be compatible with the Ribbon documentation.
This allows you to change behavior at start up time in different environments.
The supported properties are listed below and should be prefixed by <clientName>.ribbon.:
NFLoadBalancerClassName: should implement ILoadBalancerNFLoadBalancerRuleClassName: should implement IRuleNFLoadBalancerPingClassName: should implement IPingNIWSServerListClassName: should implement ServerListNIWSServerListFilterClassName should implement ServerListFilter![]() | Note |
|---|---|
Classes defined in these properties have precedence over beans defined using |
To set the IRule for a service name users you could set the following:
application.yml.
users:
ribbon:
NIWSServerListClassName: com.netflix.loadbalancer.ConfigurationBasedServerList
diff --git a/spring-cloud-netflix.xml b/spring-cloud-netflix.xml
index e0de5e60a..b1e7d1614 100644
--- a/spring-cloud-netflix.xml
+++ b/spring-cloud-netflix.xml
@@ -719,60 +719,13 @@ explicitly in the @ComponentScan ).
Creating a bean of one of those type and placing it in a @RibbonClient
configuration (such as FooConfiguration above) allows you to override each
one of the beans described. Example:
-@Configuration
-protected static class FooConfiguration {
- @Bean
- public ZonePreferenceServerListFilter serverListFilter() {
- ZonePreferenceServerListFilter filter = new ZonePreferenceServerListFilter();
- filter.setZone("myTestZone");
- return filter;
- }
-
- @Bean
- public IPing ribbonPing() {
- return new PingUrl();
- }
-}
+Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/RibbonClientsPreprocessorIntegrationTests.java[tags=sample_override_ribbon_config,indent=0]
This replaces the NoOpPing with PingUrl and provides a custom serverListFilter
Customizing default for all Ribbon Clients
A default configuration can be provided for all Ribbon Clients using the @RibbonClients annotation and registering a default configuration as shown in the following example:
-@RibbonClients(defaultConfiguration = DefaultRibbonConfig.class)
-public class RibbonClientDefaultConfigurationTestsConfig {
-
- public static class BazServiceList extends ConfigurationBasedServerList {
- public BazServiceList(IClientConfig config) {
- super.initWithNiwsConfig(config);
- }
- }
-}
-
-@Configuration
-class DefaultRibbonConfig {
-
- @Bean
- public IRule ribbonRule() {
- return new BestAvailableRule();
- }
-
- @Bean
- public IPing ribbonPing() {
- return new PingUrl();
- }
-
- @Bean
- public ServerList<Server> ribbonServerList(IClientConfig config) {
- return new RibbonClientDefaultConfigurationTestsConfig.BazServiceList(config);
- }
-
- @Bean
- public ServerListSubsetFilter serverListFilter() {
- ServerListSubsetFilter filter = new ServerListSubsetFilter();
- return filter;
- }
-
-}
+Unresolved directive in spring-cloud-netflix.adoc - include::../../../../spring-cloud-netflix-core/src/test/java/org/springframework/cloud/netflix/ribbon/test/RibbonClientDefaultConfigurationTestsConfig.java[tags=sample_default_ribbon_config,indent=0]
Customizing the Ribbon Client using properties