use of reactor.netty.Metrics.REMOTE_ADDRESS in project reactor-netty by reactor.
the class HttpMetricsHandlerTests method testIssue896.
@Test
void testIssue896() throws Exception {
disposableServer = httpServer.noSSL().bindNow();
CountDownLatch latch = new CountDownLatch(1);
httpClient.observe((conn, state) -> conn.channel().closeFuture().addListener(f -> latch.countDown())).secure(spec -> spec.sslContext(clientCtx11)).post().uri("/1").send(ByteBufFlux.fromString(Mono.just("hello"))).responseContent().subscribe();
assertThat(latch.await(30, TimeUnit.SECONDS)).as("latch await").isTrue();
Thread.sleep(1000);
InetSocketAddress sa = (InetSocketAddress) disposableServer.channel().localAddress();
String serverAddress = sa.getHostString() + ":" + sa.getPort();
String[] summaryTags = new String[] { REMOTE_ADDRESS, serverAddress, URI, "unknown" };
checkCounter(CLIENT_ERRORS, summaryTags, true, 2);
}
Aggregations