0

I'm building microservices using Spring Cloud Netflix, Spring Data JPA, and Spring Data REST.

The responses of my services are REST-HATEOAS formatted. Is there a way to automatically add links to other microservices in my responses?

For example, saying I have 2 microservices: Team and Player. When requesting a team, is there an (easy) way to add links to players (i.e. to the Player service) ?

Nicolas
  • 1,812
  • 3
  • 19
  • 43

1 Answers1

0

Yes, considering that you're completely in a spring realm you can use spring-hateoas

Its centered around Spring MVC Controllers, and I guess that you have a controller as a front of your Player service.

You'll find here a short intro guide with an analogues customer - orders example. The main thing is that you're able to automate link building without any hard coding, which really simplifies the maintenance

Master Slave
  • 27,771
  • 4
  • 57
  • 55
  • Actually I'm using RestRepositories, so most of the time I don't implement controllers (but they can be added). Anyway, this solution works but I wondered if it can be done in a more automated way (maybe with a Feign/Spring-data-rest integration ) – Nicolas Jun 03 '16 at 08:43