use of reactor.netty.http.client.HttpClientResponse in project pinpoint by naver.
the class ReactorNettyPluginTestController method clientPost.
@RequestMapping(value = "/client/post", method = RequestMethod.GET)
@ResponseBody
public String clientPost() {
HttpClient client = HttpClient.create().port(80);
HttpClientResponse response = client.post().uri("https://www.google.com/").send(ByteBufFlux.fromString(Mono.just("hello"))).response().block();
return response.toString();
}
use of reactor.netty.http.client.HttpClientResponse in project reactor-netty by reactor.
the class TracingChannelInboundHandler method channelRead.
@Override
@SuppressWarnings("try")
public void channelRead(ChannelHandlerContext ctx, Object msg) {
Span span = ctx.channel().attr(SPAN_ATTR_KEY).get();
if (span != null) {
try (Scope scope = currentTraceContext.maybeScope(span.context())) {
ctx.fireChannelRead(msg);
}
return;
} else {
ChannelOperations<?, ?> ops = ChannelOperations.get(ctx.channel());
if (ops instanceof HttpClientResponse) {
TraceContext parent = ((HttpClientResponse) ops).currentContextView().getOrDefault(TraceContext.class, null);
if (parent != null) {
try (Scope scope = currentTraceContext.maybeScope(parent)) {
ctx.fireChannelRead(msg);
}
return;
}
}
}
ctx.fireChannelRead(msg);
}
Aggregations