RestTemplate restTemplate = new RestTemplate();
String result = restTemplate.getForObject("http://localhost:8080/api/service", String.class);
System.out.println(result);
WebClient client = WebClient.create();
Mono<String> result = client.get()
.uri("http://localhost:8080/api/service")
.retrieve()
.bodyToMono(String.class);
result.subscribe(System.out::println);
@FeignClient(name = "remoteService", url = "http://localhost:8080/api")
public interface RemoteServiceClient {
@GetMapping("/service")
String getServiceData();
}