I have several microservices communicating each other with OpenFeign
. Each one is a submodule of a project(call it "parent"), with its own docker container.
OK. So, when I want to build a client with feign.builder().target()
method, an error occurs claiming that "target values must be absolute". I checked the source code, and it means (feign.RequestTemplate.target(RequestTemplate.java:447)
):
public static boolean isAbsolute(String uri) {
return uri != null && !uri.isEmpty() && uri.startsWith("http");
}
Here comes the question: the url of other services are like:
another-service:8080/check
In local tests, this is not a problem, because the profile local
has http://localhost:8080
and so on. But in an end-to-end test this cannot bypass the absolute check.
So, what to do now?