0
我的Spring webflux控制器需要访问远程TCP服务器。我怎样才能将来自TCP服务器的响应流式传输到客户端?从RestController中的TCP服务器获取响应
喜欢的东西:
WebClient client = WebClient.create("http://example.com");
....
@GetMapping(value = "/account")
public Mono<String> account() {
Mono<Account> account = client.get()
.url("/accounts/{id}", 1L)
.accept(APPLICATION_JSON)
.exchange(request)
.then(response -> response.bodyToMono(Account.class));
return account;
}
但用的TcpClient(不是Web客户端)。
感谢,
--nick