添加负载均衡操作
This commit is contained in:
@@ -0,0 +1,22 @@
|
||||
package com.njcn.microservice.config;
|
||||
|
||||
import com.netflix.loadbalancer.IRule;
|
||||
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 {
|
||||
|
||||
@Bean
|
||||
public IRule getLoadBalancerRule(){
|
||||
return new NacosWeightLoadBalanceRule();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user