- 使用 Spring Initializr 创建 Spring Boot 应用程序
- 在Spring Boot中配置Cassandra
- 在 Spring Boot 上配置 Tomcat 连接池
- 将Camel消息路由到嵌入WildFly的Artemis上
本文整理了Java中com.netflix.loadbalancer.ZoneAwareLoadBalancer.<init>()
方法的一些代码示例,展示了ZoneAwareLoadBalancer.<init>()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ZoneAwareLoadBalancer.<init>()
方法的具体详情如下:
包路径:com.netflix.loadbalancer.ZoneAwareLoadBalancer
类名称:ZoneAwareLoadBalancer
方法名:<init>
暂无
代码示例来源:origin: Nepxion/Discovery
@Bean
public ILoadBalancer ribbonLoadBalancer(IClientConfig config, ServerList<Server> serverList, ServerListFilter<Server> serverListFilter, IRule rule, IPing ping, ServerListUpdater serverListUpdater) {
if (this.propertiesFactory.isSet(ILoadBalancer.class, serviceId)) {
return this.propertiesFactory.get(ILoadBalancer.class, config, serviceId);
}
ZoneAwareLoadBalancer<?> loadBalancer = new ZoneAwareLoadBalancer<>(config, rule, ping, serverList, serverListFilter, serverListUpdater);
loadBalanceListenerExecutor.setLoadBalancer(loadBalancer);
return loadBalancer;
}
}
代码示例来源:origin: org.springframework.cloud/spring-cloud-netflix-ribbon
@Bean
@ConditionalOnMissingBean
public ILoadBalancer ribbonLoadBalancer(IClientConfig config,
ServerList<Server> serverList, ServerListFilter<Server> serverListFilter,
IRule rule, IPing ping, ServerListUpdater serverListUpdater) {
if (this.propertiesFactory.isSet(ILoadBalancer.class, name)) {
return this.propertiesFactory.get(ILoadBalancer.class, config, name);
}
return new ZoneAwareLoadBalancer<>(config, rule, ping, serverList,
serverListFilter, serverListUpdater);
}
代码示例来源:origin: com.netflix.ribbon/ribbon-loadbalancer
/**
* Build a {@link ZoneAwareLoadBalancer} with a dynamic {@link ServerList} and an {@link IRule}. The {@link ServerList} can be
* either set in the {@link #withDynamicServerList(ServerList)} or in the {@link IClientConfig} using {@link CommonClientConfigKey#NIWSServerListClassName}.
* The {@link IRule} can be either set by {@link #withRule(IRule)} or in the {@link IClientConfig} using
* {@link CommonClientConfigKey#NFLoadBalancerRuleClassName}.
*/
public ZoneAwareLoadBalancer<T> buildDynamicServerListLoadBalancer() {
if (serverListImpl == null) {
serverListImpl = createServerListFromConfig(config);
}
if (rule == null) {
rule = createRuleFromConfig(config);
}
return new ZoneAwareLoadBalancer<T>(config, rule, ping, serverListImpl, serverListFilter);
}
代码示例来源:origin: com.netflix.ribbon/ribbon-loadbalancer
/**
* Build a {@link ZoneAwareLoadBalancer} with a dynamic {@link ServerList} and an {@link IRule} and a {@link ServerListUpdater}.
*
* The {@link ServerList} can be either set in the {@link #withDynamicServerList(ServerList)} or in the {@link IClientConfig}
* using {@link CommonClientConfigKey#NIWSServerListClassName}.
* The {@link IRule} can be either set by {@link #withRule(IRule)} or in the {@link IClientConfig} using
* {@link CommonClientConfigKey#NFLoadBalancerRuleClassName}.
* The {@link ServerListUpdater} can be either set by {@link #withServerListUpdater(ServerListUpdater)} or
* in the {@link IClientConfig} using {@link CommonClientConfigKey#ServerListUpdaterClassName}.
*/
public ZoneAwareLoadBalancer<T> buildDynamicServerListLoadBalancerWithUpdater() {
if (serverListImpl == null) {
serverListImpl = createServerListFromConfig(config);
}
if (rule == null) {
rule = createRuleFromConfig(config);
}
if (serverListUpdater == null) {
serverListUpdater = createServerListUpdaterFromConfig(config);
}
return new ZoneAwareLoadBalancer<T>(config, rule, ping, serverListImpl, serverListFilter, serverListUpdater);
}
代码示例来源:origin: org.apache.camel/camel-ribbon
private ZoneAwareLoadBalancer<RibbonServiceDefinition> createLoadBalancer(String serviceName) {
// setup client config
IClientConfig config = configuration.getClientName() != null
? IClientConfig.Builder.newBuilder(configuration.getClientName()).build()
: IClientConfig.Builder.newBuilder().build();
if (configuration.getProperties() != null) {
for (Map.Entry<String, String> entry : configuration.getProperties().entrySet()) {
IClientConfigKey key = CommonClientConfigKey.valueOf(entry.getKey());
String value = entry.getValue();
LOGGER.debug("RibbonClientConfig: {}={}", key.key(), value);
config.set(key, value);
}
}
ZoneAwareLoadBalancer<RibbonServiceDefinition> loadBalancer;
if (serviceDiscovery != null) {
loadBalancer = new ZoneAwareLoadBalancer<>(
config,
configuration.getRuleOrDefault(RoundRobinRule::new),
configuration.getPingOrDefault(DummyPing::new),
new RibbonServerList(serviceName, serviceDiscovery, serviceFilter),
null,
new PollingServerListUpdater(config));
} else {
loadBalancer = new ZoneAwareLoadBalancer<>(config);
}
return loadBalancer;
}
本文整理了Java中com.netflix.loadbalancer.ZoneAwareLoadBalancer.chooseServer()方法的一些代码示例,展示了ZoneAwareLoadBal
本文整理了Java中com.netflix.loadbalancer.ZoneAwareLoadBalancer.()方法的一些代码示例,展示了ZoneAwareLoadBalancer.()的具体用
本文整理了Java中com.netflix.loadbalancer.ZoneAwareLoadBalancer.getName()方法的一些代码示例,展示了ZoneAwareLoadBalancer
本文整理了Java中com.netflix.loadbalancer.ZoneAwareLoadBalancer.getServerListImpl()方法的一些代码示例,展示了ZoneAwareLo
我是一名优秀的程序员,十分优秀!