I've defined an REST interface that has a different Spring Boot Application implementation using different spring.application.name
(spring.application.name
can not be the same in my business).
How can I only define a Feign Client, and can access all the SpringBootApplication REST Services?
SpringBootApplication A(spring.application.name=A) and B(spring.application.name=) has this RestService:
@RestController
@RequestMapping(value = "/${spring.application.name}")
public class FeignRestService {
@Autowired
Environment env;
@RequestMapping(path = "/feign")
public String feign() {
return env.getProperty("server.port");
}
}
another SpringBootApplication C:
@FeignClient(name="SpringApplication A or B")
public interface FeignClientService {
@RequestMapping(path = "/feign")
public String feign();
}
In SpringBootApplication C, I want to use a FeignClientService to access A and B. Do you have any idea?