回答

1

你是後功能可通過InstanceRegistry,其本身只是Netflix的尤里卡類(PeerAwareInstanceRegistryImplAbstractInstanceRegistry)的延伸。

具體而言,AbstractInstanceRegistry#cancel(String,String,boolean)方法應該從註冊表中刪除應用程序。

此方法狀態的Javadoc:

/** 
* Cancels the registration of an instance. 
* 
* <p> 
* This is normally invoked by a client when it shuts down informing the 
* server to remove the instance from traffic. 
* </p> 
* 
* @param appName the application name of the application. 
* @param id the unique identifier of the instance. 
* @param isReplication true if this is a replication event from other nodes, false 
*      otherwise. 
* @return true if the instance was removed from the {@link AbstractInstanceRegistry} successfully, false otherwise. 
*/ 

這是你將如何從尤里卡服務器本身實現這一目標。

相關問題