use of org.apache.servicecomb.serviceregistry.api.response.GetServiceResponse in project incubator-servicecomb-java-chassis by apache.
the class ServiceRegistryClientImpl method getMicroservice.
@Override
public Microservice getMicroservice(String microserviceId) {
Holder<GetServiceResponse> holder = new Holder<>();
IpPort ipPort = ipPortManager.getAvailableAddress();
CountDownLatch countDownLatch = new CountDownLatch(1);
RestUtils.get(ipPort, String.format(Const.REGISTRY_API.MICROSERVICE_OPERATION_ONE, microserviceId), new RequestParam(), syncHandler(countDownLatch, GetServiceResponse.class, holder));
try {
countDownLatch.await();
if (holder.value != null) {
return holder.value.getService();
}
} catch (Exception e) {
LOGGER.error("query microservice {} failed", microserviceId, e);
}
return null;
}
Aggregations