0

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.

paskos
  • 689
  • 8
  • 21

1 Answers1

1

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

Community
  • 1
  • 1
Ákos Ratku
  • 1,421
  • 12
  • 14
  • My understanding is that the links inside `spring-data-rest` HAL responses (`link` or `self`) are generated by the server itself based on the incoming request. Since the requests are issued by `Ribbon` they will contain the "real" host of the server. Therefore the links will contain the particular server host. If I understand well. `Ribbon` will then not be used to load balance them. Am I wrong ? – paskos Sep 20 '15 at 16:29
  • Thanks a lot. Now maybe another question in itself. How and where (service A or service B) should I modify links to "point" to the service name instead of the "real" host ? And is that even possible ? – paskos Sep 20 '15 at 20:13
  • On the side it is produced. Something like this : http://stackoverflow.com/questions/22024716/spring-data-rest-base-path – Ákos Ratku Sep 21 '15 at 16:24