3 import org.springframework.web.reactive.function.client.WebClient;
4 import reactor.core.publisher.Mono;
8 * Fetches data from remote-webserver.
11 public class RemoteContentService
17 * The {@link WebClient}, that is used to fetch the data.
19 * The <code>WebClient</code> has to be configured to us a given
20 * remote-server by default. This service will only add a path.
21 * @param webClient a <code>WebClient</code> instance with configured host
23 public RemoteContentService(WebClient webClient)
25 this.webClient = webClient;
30 * Fetches the given path from the configured remote-server.
31 * @param path the path to fetch from the configured remote-server
32 * @return a {@link Mono}, that represents the fetched data
34 public Mono<String> getRemoteText(String path)
41 .bodyToMono(String.class);