private static ResolvedEndpoint ParseQueryToEndpoint(ClientRegionLocale locale, string serviceType, CatalogServiceNodeEntry[] result) { if (!QueryResultIsValid(result)) { ThrowQueryException(locale, serviceType); } //TODO: Check health //TODO: Manual loadbalancing roadrobin? CatalogServiceNodeEntry entry = result.First(); return(ConvertConsulEntryToEndpoint(entry)); }
private static ResolvedEndpoint ConvertConsulEntryToEndpoint(CatalogServiceNodeEntry entry) { //We need to use ServiceAddress and not Address. Address is the Consul address. return(new ResolvedEndpoint(entry.ServiceAddress, entry.ServicePort)); }