use of io.servicecomb.serviceregistry.api.response.GetAllServicesResponse in project java-chassis by ServiceComb.
the class ServiceRegistryClientImpl method getAllMicroservices.
@Override
public List<Microservice> getAllMicroservices() {
Holder<GetAllServicesResponse> holder = new Holder<>();
IpPort ipPort = IpPortManager.INSTANCE.get();
CountDownLatch countDownLatch = new CountDownLatch(1);
RestUtils.get(ipPort, Const.MS_API_PATH + Const.MICROSERVICE_PATH, new RequestParam(), syncHandler(countDownLatch, GetAllServicesResponse.class, holder));
try {
countDownLatch.await();
if (holder.value != null) {
return holder.value.getServices();
}
} catch (Exception e) {
LOGGER.error("query all microservices failed", e);
}
return null;
}
Aggregations