Search code examples
spring-data-restspring-cloudhal-json

Does Ribbon load balance spring-data-rest HAL resources links


If I have 2 instances of service A implemented using spring-data-rest that register themselves in spring-cloud eureka and client app B using Ribbon client-side load balancing would HAL links inside A responses be load balanced by Ribbon when B follows them ?

PS: I know I could build a prototype to test myself but I'm strapped for time.

Thanks in advance.


Solution

  • First of all, feign is only the http-client side of it, Ribbon does the load balancing.

    Load balancing is possible if the feign clients are registered with a serviceId and not an actual host.

    I am not sure what you mean by following, but if you are referencing an actual host in the links (and not serviceId-s) ribbon won't loadbalance.

    I think this thread relates to your question:

    Linking between objects on different apps with Spring HATEOAS