Collection<ServiceInstance> serviceInstances = provider.getAllInstances(); // provider is a curator.ServiceProvider List<ResolvedServerInfo> infoGroups = new ArrayList<>(); for (ServiceInstance serviceInstance : serviceInstances) { infoGroups.add(new ResolvedServerInfo( InetSocketAddress.createUnresolved(serviceInstance.getAddress(), serviceInstance.getPort()), Attributes.EMPTY)); } listener.onUpdate(Collections.singletonList(infoGroups), Attributes.EMPTY);
Collection<ServiceInstance> serviceInstances = provider.getAllInstances(); List<ResolvedServerInfo> serverInfos = new ArrayList<>(); for (ServiceInstance serviceInstance : serviceInstances) { serverInfos.add(new ResolvedServerInfo( InetSocketAddress.createUnresolved(serviceInstance.getAddress(), serviceInstance.getPort()))); } listener.onUpdate(Collections.singletonList(ResolvedServerInfoGroup.builder().addAll(serverInfos).build()), Attributes.EMPTY);
io.grpc.StatusRuntimeException: UNAVAILABLE: Channel in TRANSIENT_FAILURE state at io.grpc.stub.ClientCalls.toStatusRuntimeException(ClientCalls.java:227) at io.grpc.stub.ClientCalls.getUnchecked(ClientCalls.java:208)
Jorg