use of com.tencent.polaris.api.rpc.GetServicesRequest in project polaris-java by polarismesh.
the class GetServicesExample method main.
public static void main(String[] args) throws Exception {
InitResult initResult = ExampleUtils.initConsumerConfiguration(args, true);
String namespace = initResult.getNamespace();
try (ConsumerAPI consumerAPI = ExampleUtils.createConsumerAPI(initResult.getConfig())) {
System.out.println("namespace " + namespace);
GetServicesRequest request = new GetServicesRequest();
request.setNamespace(namespace);
ServicesResponse response = consumerAPI.getServices(request);
List<ServiceInfo> services = response.getServices();
System.out.println("services count is " + services.size());
System.out.println("print all service " + services);
request = new GetServicesRequest();
request.setNamespace(namespace);
response = consumerAPI.getServices(request);
services = response.getServices();
System.out.println("services count is " + services.size());
System.out.println("print all service " + services);
}
}
use of com.tencent.polaris.api.rpc.GetServicesRequest in project spring-cloud-tencent by Tencent.
the class PolarisDiscoveryHandler method GetServices.
/**
* Return all service for given namespace.
* @return service list
*/
public ServicesResponse GetServices() {
String namespace = polarisDiscoveryProperties.getNamespace();
GetServicesRequest request = new GetServicesRequest();
request.setNamespace(namespace);
return polarisConsumer.getServices(request);
}
Aggregations