代码更新
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.njcn.microservice.compent;
|
||||
|
||||
import com.alibaba.cloud.nacos.NacosDiscoveryProperties;
|
||||
@@ -12,17 +13,19 @@ import com.netflix.loadbalancer.Server;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
|
||||
*/
|
||||
/**
|
||||
* 自定义负载均衡算法
|
||||
*/
|
||||
*//*
|
||||
|
||||
public class NacosWeightLoadBalanceRule extends AbstractLoadBalancerRule {
|
||||
|
||||
|
||||
@Override
|
||||
public void initWithNiwsConfig(IClientConfig clientConfig) {}
|
||||
|
||||
|
||||
@Resource
|
||||
private NacosDiscoveryProperties nacosDiscoveryProperties;
|
||||
|
||||
|
||||
@Override
|
||||
public Server choose(Object key) {
|
||||
// 1.获取服务的名称
|
||||
@@ -38,4 +41,4 @@ public class NacosWeightLoadBalanceRule extends AbstractLoadBalancerRule {
|
||||
}
|
||||
return null;
|
||||
}
|
||||
}
|
||||
}*/
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
/*
|
||||
package com.njcn.microservice.config;
|
||||
|
||||
import com.netflix.loadbalancer.IRule;
|
||||
@@ -5,11 +6,13 @@ import com.njcn.microservice.compent.NacosWeightLoadBalanceRule;
|
||||
import org.springframework.context.annotation.Bean;
|
||||
import org.springframework.context.annotation.Configuration;
|
||||
|
||||
*/
|
||||
/**
|
||||
* @author hongawen
|
||||
* @version 1.0.0
|
||||
* @date 2022年08月25日 19:53
|
||||
*/
|
||||
*//*
|
||||
|
||||
@Configuration
|
||||
public class RibbonConfig {
|
||||
|
||||
@@ -20,3 +23,4 @@ public class RibbonConfig {
|
||||
|
||||
|
||||
}
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user