Spring HATEOAS works great at linking to another method in the same application. For example:
Greeting greeting = new Greeting(String.format(TEMPLATE, name));
greeting.add(linkTo(methodOn(GreetingController.class).greeting(name)).withSelfRel());
If one were to implement a microservice architecture, then most of the linked methods would be part of a different service and different Java project.
The only way I can see of to add a link to a method outside of the existing project is to hard-code in the URL (or put it in an external configuration).
Are there any alternatives to dynamically create the URL? For instance, is it possible to use Spring HATEOAS in conjunction with a Service Registry (like Eureka)?