spring-projects / spring-hateoas-examples

Collection of examples on how (and why) to build hypermedia-driven apps with Spring HATEOAS
Apache License 2.0
377 stars 184 forks source link

Looking for an example to use hateoas with microservices #19

Open cyril-gambis opened 5 years ago

cyril-gambis commented 5 years ago

Hi,

I discovered these examples in a Feign ticket: this one. They are great!

Is there also an example that describe how, from a "Best Practice" view, to make several HATEOAS services communicate with each other ? I currently use Feign to do that, but as @gregturn answered, this is probably not the best way, since Feign uses hard coded URLs and breaks some of the HATEOAS purposes.

So, for instance, if a user wants to book a meeting with a teacher, and if the service that manage the booking must communicate with a schedule-service (which knows about the teacher availabilites) and a teacher-service (which knows about teacher properties), how can it request these other services? Of course, I understand that we can use RestTemplate to issue these requests; I am just wondering if there is an existing example that could guide us as the best way to do this, as good as the api-evolution example and the hypermedia example.

Thanks!