parent
5f5972e6b3
commit
a4c44b9a17
|
@ -40,4 +40,17 @@ public class GatewayController {
|
||||||
public void scheduleECS(){
|
public void scheduleECS(){
|
||||||
gatewayLoadService.scheduleECS();
|
gatewayLoadService.scheduleECS();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新负载规则 实现动态负载
|
||||||
|
*/
|
||||||
|
@Scheduled(cron = "0/30 * * * * ?")
|
||||||
|
public void refresh(){
|
||||||
|
gatewayLoadService.refresh();
|
||||||
|
}
|
||||||
|
|
||||||
|
@Scheduled(cron = "0/30 * * * * ?")
|
||||||
|
public void dynamicEcs()throws Exception{
|
||||||
|
gatewayLoadService.dynamicEcs();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -12,8 +12,18 @@ public interface GatewayLoadService {
|
||||||
*/
|
*/
|
||||||
String loadNode();
|
String loadNode();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询ECS车辆连接数
|
||||||
|
*/
|
||||||
void scheduleECS();
|
void scheduleECS();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 刷新负载规则 实现动态负载
|
||||||
|
*/
|
||||||
void refresh();
|
void refresh();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 动态ECS
|
||||||
|
*/
|
||||||
|
void dynamicEcs() throws Exception;
|
||||||
}
|
}
|
||||||
|
|
|
@ -76,6 +76,9 @@ public class GatewayLoadServiceImpl implements GatewayLoadService {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 查询ECS车辆连接数
|
||||||
|
*/
|
||||||
@Override
|
@Override
|
||||||
public void scheduleECS() {
|
public void scheduleECS() {
|
||||||
//客户端初始化
|
//客户端初始化
|
||||||
|
@ -190,6 +193,7 @@ public class GatewayLoadServiceImpl implements GatewayLoadService {
|
||||||
/**
|
/**
|
||||||
* 动态ECS
|
* 动态ECS
|
||||||
*/
|
*/
|
||||||
|
@Override
|
||||||
public void dynamicEcs() throws Exception {
|
public void dynamicEcs() throws Exception {
|
||||||
//上线最大数量
|
//上线最大数量
|
||||||
Long vehicleMaxOnlineNum = gatewayNodeScoreCache.getNodeMaxOnlineNum();
|
Long vehicleMaxOnlineNum = gatewayNodeScoreCache.getNodeMaxOnlineNum();
|
||||||
|
|
Loading…
Reference in New Issue