pnxtech / hydra

A light-weight library for building distributed applications such as microservices
https://www.hydramicroservice.com
MIT License
645 stars 54 forks source link

deterministic service instance selection with retry logic #32

Closed cjus closed 7 years ago

cjus commented 7 years ago

PR to switch from random load balancing to a deterministic model where the service instance which has most recently reported presence status is favored. The premise is that instance which which have not recently reported presence are more likely to have experienced a fatal issue.

_makeAPIRequest now supports retries if a service endpoint returns an error. When that happens another service instance is immediately selected as a retry target.