customize getting service instance in service subscribe.
parent
aff20a84a7
commit
7dd7fa9c49
@ -0,0 +1,23 @@
|
|||||||
|
package com.alibaba.cloud.dubbo.metadata.repository;
|
||||||
|
|
||||||
|
import org.springframework.cloud.client.ServiceInstance;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Optional;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* metadata service instance selector
|
||||||
|
*
|
||||||
|
* @author liuxx
|
||||||
|
* @date 2019/9/4
|
||||||
|
*/
|
||||||
|
public interface MetadataServiceInstanceSelector {
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* choose a service instance to get metadata
|
||||||
|
* @param serviceInstances all service instance
|
||||||
|
* @return the service instance to get metadata
|
||||||
|
*/
|
||||||
|
Optional<ServiceInstance> choose(List<ServiceInstance> serviceInstances);
|
||||||
|
}
|
Loading…
Reference in New Issue