The scenario looks like that:
- eureka server and two other services (spring-boot-apps) are running
- two micro services (A and B) are registered in eureka server
- both services provides REST HATEOAS endpoint
- app 'A' provides a service method 'x' which response message should contains a link to a remote REST endpoint 'y' from a service 'B'
My idea was to use: DynamicServiceInstanceProvider and Traverson to finally get a Link object.
DynamicServiceInstanceProvider provider = new DynamicServiceInstanceProvider(discoveryClient, "B");
Traverson traverson = new Traverson(provider.getUri(), MediaTypes.HAL_JSON);
Link link = traverson.follow("y").asTemplatedLink();
Unfortunately it doesn't work at all :/ What I'm doing wrong? Is there a better way to obtain a link to a remote endpoint?