Merge pull request #1426 from IanCao/master

【issue】 #1425
This commit is contained in:
Fury Zhu 2019-06-27 18:51:38 +08:00 committed by GitHub
commit 00f989f51e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 0 deletions

View File

@ -138,6 +138,14 @@ public interface NamingService {
*/
void deregisterInstance(String serviceName, String groupName, String ip, int port, String clusterName) throws NacosException;
/**
* deregister instance with full instance information and default groupName
* @param serviceName
* @param instance
* @throws NacosException
*/
void deregisterInstance(String serviceName, Instance instance) throws NacosException;
/**
* deregister instance with full instance information
*

View File

@ -231,6 +231,11 @@ public class NacosNamingService implements NamingService {
deregisterInstance(serviceName, groupName, instance);
}
@Override
public void deregisterInstance(String serviceName, Instance instance) throws NacosException {
deregisterInstance(serviceName, Constants.DEFAULT_GROUP, instance);
}
@Override
public void deregisterInstance(String serviceName, String groupName, Instance instance) throws NacosException {
beatReactor.removeBeatInfo(NamingUtils.getGroupedName(serviceName, groupName), instance.getIp(), instance.getPort());