You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2017/07/03 12:52:19 UTC
[3/3] httpcomponents-core git commit: Logging improvements in classic
(blocking) test server and client
Logging improvements in classic (blocking) test server and client
Project: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/repo
Commit: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/commit/22b30a66
Tree: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/tree/22b30a66
Diff: http://git-wip-us.apache.org/repos/asf/httpcomponents-core/diff/22b30a66
Branch: refs/heads/master
Commit: 22b30a6657faf54ee910d00a0591bcc4dc7d2acf
Parents: b4756bb
Author: Oleg Kalnichevski <ol...@apache.org>
Authored: Mon Jul 3 14:36:34 2017 +0200
Committer: Oleg Kalnichevski <ol...@apache.org>
Committed: Mon Jul 3 14:48:18 2017 +0200
----------------------------------------------------------------------
.../testing/classic/ClassicTestClient.java | 16 +---
.../testing/classic/ClassicTestServer.java | 50 +---------
.../LoggingBHttpClientConnectionFactory.java | 47 ++++++++++
.../LoggingBHttpServerConnectionFactory.java | 52 +++++++++++
.../classic/LoggingConnPoolListener.java | 72 +++++++++++++++
.../classic/LoggingExceptionListener.java | 63 +++++++++++++
.../classic/LoggingHttp1StreamListener.java | 96 ++++++++++++++++++++
.../core5/testing/classic/LoggingSupport.java | 44 +++++++++
.../InternalClientHttp1EventHandlerFactory.java | 1 +
.../InternalClientHttp2EventHandlerFactory.java | 1 +
.../InternalServerHttp1EventHandlerFactory.java | 1 +
.../InternalServerHttp2EventHandlerFactory.java | 1 +
.../testing/nio/LoggingConnPoolListener.java | 72 ---------------
.../testing/nio/LoggingHttp1StreamListener.java | 96 --------------------
.../testing/nio/LoggingHttp2StreamListener.java | 1 +
.../testing/nio/LoggingIOSessionListener.java | 1 +
.../hc/core5/testing/nio/LoggingSupport.java | 44 ---------
.../nio/Http1ServerAndRequesterTest.java | 2 +
.../nio/Http2ProtocolNegotiationTest.java | 2 +
.../nio/Http2ServerAndRequesterTest.java | 2 +
20 files changed, 393 insertions(+), 271 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestClient.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestClient.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestClient.java
index 4c1c047..0291813 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestClient.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestClient.java
@@ -28,7 +28,6 @@
package org.apache.hc.core5.testing.classic;
import java.io.IOException;
-import java.net.Socket;
import java.util.concurrent.atomic.AtomicReference;
import javax.net.ssl.SSLContext;
@@ -37,11 +36,9 @@ import org.apache.hc.core5.http.ClassicHttpRequest;
import org.apache.hc.core5.http.ClassicHttpResponse;
import org.apache.hc.core5.http.HttpException;
import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.http.config.H1Config;
import org.apache.hc.core5.http.config.SocketConfig;
import org.apache.hc.core5.http.impl.bootstrap.HttpRequester;
import org.apache.hc.core5.http.impl.bootstrap.RequesterBootstrap;
-import org.apache.hc.core5.http.io.HttpConnectionFactory;
import org.apache.hc.core5.http.protocol.HttpContext;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.io.ShutdownType;
@@ -78,7 +75,9 @@ public class ClassicTestClient {
final HttpRequester requester = RequesterBootstrap.bootstrap()
.setSslSocketFactory(sslContext != null ? sslContext.getSocketFactory() : null)
.setHttpProcessor(httpProcessor)
- .setConnectFactory(new LoggingConnFactory())
+ .setConnectFactory(LoggingBHttpClientConnectionFactory.INSTANCE)
+ .setStreamListener(LoggingHttp1StreamListener.INSTANCE_CLIENT)
+ .setConnPoolListener(LoggingConnPoolListener.INSTANCE)
.create();
requesterRef.compareAndSet(null, requester);
} else {
@@ -108,13 +107,4 @@ public class ClassicTestClient {
return requester.execute(targetHost, request, socketConfig.getSoTimeout(), context);
}
- class LoggingConnFactory implements HttpConnectionFactory<LoggingBHttpClientConnection> {
-
- @Override
- public LoggingBHttpClientConnection createConnection(final Socket socket) throws IOException {
- final LoggingBHttpClientConnection conn = new LoggingBHttpClientConnection(H1Config.DEFAULT);
- conn.bind(socket);
- return conn;
- }
- }
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestServer.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestServer.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestServer.java
index 97067f8..1afa6e6 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestServer.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/ClassicTestServer.java
@@ -29,29 +29,19 @@ package org.apache.hc.core5.testing.classic;
import java.io.IOException;
import java.net.InetAddress;
-import java.net.Socket;
-import java.net.SocketException;
import java.util.concurrent.atomic.AtomicReference;
import javax.net.ssl.SSLContext;
-import javax.net.ssl.SSLSocket;
-import org.apache.hc.core5.http.ConnectionClosedException;
-import org.apache.hc.core5.http.ExceptionListener;
-import org.apache.hc.core5.http.HttpConnection;
-import org.apache.hc.core5.http.URIScheme;
-import org.apache.hc.core5.http.config.H1Config;
import org.apache.hc.core5.http.config.SocketConfig;
import org.apache.hc.core5.http.impl.bootstrap.HttpServer;
import org.apache.hc.core5.http.impl.bootstrap.ServerBootstrap;
-import org.apache.hc.core5.http.io.HttpConnectionFactory;
import org.apache.hc.core5.http.io.HttpExpectationVerifier;
import org.apache.hc.core5.http.io.HttpRequestHandler;
import org.apache.hc.core5.http.io.UriHttpRequestHandlerMapper;
import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.io.ShutdownType;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
+
public class ClassicTestServer {
private final SSLContext sslContext;
@@ -108,8 +98,9 @@ public class ClassicTestServer {
.setHttpProcessor(httpProcessor)
.setExpectationVerifier(expectationVerifier)
.setHandlerMapper(this.registry)
- .setConnectionFactory(new LoggingConnFactory())
- .setExceptionListener(new SimpleExceptionListener())
+ .setConnectionFactory(LoggingBHttpServerConnectionFactory.INSTANCE)
+ .setStreamListener(LoggingHttp1StreamListener.INSTANCE_CLIENT)
+ .setExceptionListener(LoggingExceptionListener.INSTANCE)
.create();
if (serverRef.compareAndSet(null, server)) {
server.start();
@@ -134,37 +125,4 @@ public class ClassicTestServer {
}
}
- static class LoggingConnFactory implements HttpConnectionFactory<LoggingBHttpServerConnection> {
-
- @Override
- public LoggingBHttpServerConnection createConnection(final Socket socket) throws IOException {
- final LoggingBHttpServerConnection conn = new LoggingBHttpServerConnection(
- socket instanceof SSLSocket ? URIScheme.HTTPS.id : URIScheme.HTTP.id,
- H1Config.DEFAULT);
- conn.bind(socket);
- return conn;
- }
- }
-
- static class SimpleExceptionListener implements ExceptionListener {
-
- private final Logger log = LogManager.getLogger(ClassicTestServer.class);
-
- @Override
- public void onError(final Exception ex) {
- this.log.error(ex.getMessage(), ex);
- }
-
- @Override
- public void onError(final HttpConnection conn, final Exception ex) {
- if (ex instanceof ConnectionClosedException) {
- this.log.debug(ex.getMessage());
- } else if (ex instanceof SocketException) {
- this.log.debug(ex.getMessage());
- } else {
- this.log.error(ex.getMessage(), ex);
- }
- }
- }
-
}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpClientConnectionFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpClientConnectionFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpClientConnectionFactory.java
new file mode 100644
index 0000000..9499504
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpClientConnectionFactory.java
@@ -0,0 +1,47 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.testing.classic;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import org.apache.hc.core5.http.config.H1Config;
+import org.apache.hc.core5.http.io.HttpConnectionFactory;
+
+public class LoggingBHttpClientConnectionFactory implements HttpConnectionFactory<LoggingBHttpClientConnection> {
+
+ public static final LoggingBHttpClientConnectionFactory INSTANCE = new LoggingBHttpClientConnectionFactory();
+
+ @Override
+ public LoggingBHttpClientConnection createConnection(final Socket socket) throws IOException {
+ final LoggingBHttpClientConnection conn = new LoggingBHttpClientConnection(H1Config.DEFAULT);
+ conn.bind(socket);
+ return conn;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpServerConnectionFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpServerConnectionFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpServerConnectionFactory.java
new file mode 100644
index 0000000..14d9942
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingBHttpServerConnectionFactory.java
@@ -0,0 +1,52 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.testing.classic;
+
+import java.io.IOException;
+import java.net.Socket;
+
+import javax.net.ssl.SSLSocket;
+
+import org.apache.hc.core5.http.URIScheme;
+import org.apache.hc.core5.http.config.H1Config;
+import org.apache.hc.core5.http.io.HttpConnectionFactory;
+
+public class LoggingBHttpServerConnectionFactory implements HttpConnectionFactory<LoggingBHttpServerConnection> {
+
+ public static final LoggingBHttpServerConnectionFactory INSTANCE = new LoggingBHttpServerConnectionFactory();
+
+ @Override
+ public LoggingBHttpServerConnection createConnection(final Socket socket) throws IOException {
+ final LoggingBHttpServerConnection conn = new LoggingBHttpServerConnection(
+ socket instanceof SSLSocket ? URIScheme.HTTPS.id : URIScheme.HTTP.id,
+ H1Config.DEFAULT);
+ conn.bind(socket);
+ return conn;
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingConnPoolListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingConnPoolListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingConnPoolListener.java
new file mode 100644
index 0000000..e812935
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingConnPoolListener.java
@@ -0,0 +1,72 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.testing.classic;
+
+import org.apache.hc.core5.http.HttpHost;
+import org.apache.hc.core5.pool.ConnPoolListener;
+import org.apache.hc.core5.pool.ConnPoolStats;
+import org.apache.hc.core5.pool.PoolStats;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class LoggingConnPoolListener implements ConnPoolListener<HttpHost> {
+
+ public final static LoggingConnPoolListener INSTANCE = new LoggingConnPoolListener();
+
+ private final Logger connLog = LogManager.getLogger("org.apache.hc.core5.http.connection");
+
+ private LoggingConnPoolListener() {
+ }
+
+ @Override
+ public void onLease(final HttpHost route, final ConnPoolStats<HttpHost> connPoolStats) {
+ if (connLog.isDebugEnabled()) {
+ final StringBuilder buf = new StringBuilder();
+ buf.append("Leased ").append(route).append(" ");
+ final PoolStats totals = connPoolStats.getTotalStats();
+ buf.append(" total kept alive: ").append(totals.getAvailable()).append("; ");
+ buf.append("total allocated: ").append(totals.getLeased() + totals.getAvailable());
+ buf.append(" of ").append(totals.getMax());
+ connLog.debug(buf.toString());
+ }
+ }
+
+ @Override
+ public void onRelease(final HttpHost route, final ConnPoolStats<HttpHost> connPoolStats) {
+ if (connLog.isDebugEnabled()) {
+ final StringBuilder buf = new StringBuilder();
+ buf.append("Released ").append(route).append(" ");
+ final PoolStats totals = connPoolStats.getTotalStats();
+ buf.append(" total kept alive: ").append(totals.getAvailable()).append("; ");
+ buf.append("total allocated: ").append(totals.getLeased() + totals.getAvailable());
+ buf.append(" of ").append(totals.getMax());
+ connLog.debug(buf.toString());
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingExceptionListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingExceptionListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingExceptionListener.java
new file mode 100644
index 0000000..7019f09
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingExceptionListener.java
@@ -0,0 +1,63 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.testing.classic;
+
+import java.net.SocketException;
+
+import org.apache.hc.core5.http.ConnectionClosedException;
+import org.apache.hc.core5.http.ExceptionListener;
+import org.apache.hc.core5.http.HttpConnection;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class LoggingExceptionListener implements ExceptionListener {
+
+ public final static LoggingExceptionListener INSTANCE = new LoggingExceptionListener();
+
+ private final Logger connLog = LogManager.getLogger("org.apache.hc.core5.http.connection");
+
+ @Override
+ public void onError(final Exception ex) {
+ if (ex instanceof SocketException) {
+ connLog.debug(ex.getMessage());
+ } else {
+ connLog.error(ex.getMessage(), ex);
+ }
+ }
+
+ @Override
+ public void onError(final HttpConnection conn, final Exception ex) {
+ if (ex instanceof ConnectionClosedException) {
+ connLog.debug(ex.getMessage());
+ } else if (ex instanceof SocketException) {
+ connLog.debug(ex.getMessage());
+ } else {
+ connLog.error(ex.getMessage(), ex);
+ }
+ }
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingHttp1StreamListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingHttp1StreamListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingHttp1StreamListener.java
new file mode 100644
index 0000000..ea513f1
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingHttp1StreamListener.java
@@ -0,0 +1,96 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+
+package org.apache.hc.core5.testing.classic;
+
+import java.util.Iterator;
+
+import org.apache.hc.core5.http.Header;
+import org.apache.hc.core5.http.HttpConnection;
+import org.apache.hc.core5.http.HttpRequest;
+import org.apache.hc.core5.http.HttpResponse;
+import org.apache.hc.core5.http.impl.Http1StreamListener;
+import org.apache.hc.core5.http.message.RequestLine;
+import org.apache.hc.core5.http.message.StatusLine;
+import org.apache.logging.log4j.LogManager;
+import org.apache.logging.log4j.Logger;
+
+public class LoggingHttp1StreamListener implements Http1StreamListener {
+
+ enum Type { CLIENT, SERVER }
+
+ public final static LoggingHttp1StreamListener INSTANCE_CLIENT = new LoggingHttp1StreamListener(Type.CLIENT);
+ public final static LoggingHttp1StreamListener INSTANCE_SERVER = new LoggingHttp1StreamListener(Type.SERVER);
+
+ private final Type type;
+ private final Logger connLog = LogManager.getLogger("org.apache.hc.core5.http.connection");
+ private final Logger headerLog = LogManager.getLogger("org.apache.hc.core5.http.headers");
+
+ private LoggingHttp1StreamListener(final Type type) {
+ this.type = type;
+ }
+
+ private String requestDirection() {
+ return type == Type.CLIENT ? " >> " : " << ";
+ }
+
+ private String responseDirection() {
+ return type == Type.CLIENT ? " << " : " >> ";
+ }
+
+ @Override
+ public void onRequestHead(final HttpConnection connection, final HttpRequest request) {
+ if (headerLog.isDebugEnabled()) {
+ headerLog.debug(LoggingSupport.getId(connection) + requestDirection() + new RequestLine(request));
+ for (final Iterator<Header> it = request.headerIterator(); it.hasNext(); ) {
+ headerLog.debug(LoggingSupport.getId(connection) + requestDirection() + it.next());
+ }
+ }
+ }
+
+ @Override
+ public void onResponseHead(final HttpConnection connection, final HttpResponse response) {
+ if (headerLog.isDebugEnabled()) {
+ headerLog.debug(LoggingSupport.getId(connection) + responseDirection() + new StatusLine(response));
+ for (final Iterator<Header> it = response.headerIterator(); it.hasNext(); ) {
+ headerLog.debug(LoggingSupport.getId(connection) + responseDirection() + it.next());
+ }
+ }
+ }
+
+ @Override
+ public void onExchangeComplete(final HttpConnection connection, final boolean keepAlive) {
+ if (connLog.isDebugEnabled()) {
+ if (keepAlive) {
+ connLog.debug(LoggingSupport.getId(connection) + " Connection is kept alive");
+ } else {
+ connLog.debug(LoggingSupport.getId(connection) + " Connection is not kept alive");
+ }
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingSupport.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingSupport.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingSupport.java
new file mode 100644
index 0000000..9b59ed0
--- /dev/null
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/classic/LoggingSupport.java
@@ -0,0 +1,44 @@
+/*
+ * ====================================================================
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ * ====================================================================
+ *
+ * This software consists of voluntary contributions made by many
+ * individuals on behalf of the Apache Software Foundation. For more
+ * information on the Apache Software Foundation, please see
+ * <http://www.apache.org/>.
+ *
+ */
+package org.apache.hc.core5.testing.classic;
+
+import org.apache.hc.core5.util.Identifiable;
+
+public final class LoggingSupport {
+
+ public static String getId(final Object object) {
+ if (object == null) {
+ return null;
+ }
+ if (object instanceof Identifiable) {
+ return ((Identifiable) object).getId();
+ } else {
+ return object.getClass().getSimpleName() + "-" + Integer.toHexString(System.identityHashCode(object));
+ }
+ }
+
+}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp1EventHandlerFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp1EventHandlerFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp1EventHandlerFactory.java
index 1735ee9..4ebc9fe 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp1EventHandlerFactory.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp1EventHandlerFactory.java
@@ -52,6 +52,7 @@ import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.IOEventHandlerFactory;
import org.apache.hc.core5.reactor.TlsCapableIOSession;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.Args;
/**
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp2EventHandlerFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp2EventHandlerFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp2EventHandlerFactory.java
index 567a85c..9335f7c 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp2EventHandlerFactory.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalClientHttp2EventHandlerFactory.java
@@ -44,6 +44,7 @@ import org.apache.hc.core5.http2.impl.nio.ClientHttpProtocolNegotiator;
import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.IOEventHandlerFactory;
import org.apache.hc.core5.reactor.TlsCapableIOSession;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.Args;
class InternalClientHttp2EventHandlerFactory implements IOEventHandlerFactory {
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp1EventHandlerFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp1EventHandlerFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp1EventHandlerFactory.java
index 50e8b29..8bf8504 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp1EventHandlerFactory.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp1EventHandlerFactory.java
@@ -55,6 +55,7 @@ import org.apache.hc.core5.http.protocol.HttpProcessor;
import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.IOEventHandlerFactory;
import org.apache.hc.core5.reactor.TlsCapableIOSession;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.Args;
/**
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp2EventHandlerFactory.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp2EventHandlerFactory.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp2EventHandlerFactory.java
index 548f1da..6d0d925 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp2EventHandlerFactory.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/InternalServerHttp2EventHandlerFactory.java
@@ -44,6 +44,7 @@ import org.apache.hc.core5.http2.impl.nio.ServerHttpProtocolNegotiator;
import org.apache.hc.core5.reactor.IOEventHandler;
import org.apache.hc.core5.reactor.IOEventHandlerFactory;
import org.apache.hc.core5.reactor.TlsCapableIOSession;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.Args;
class InternalServerHttp2EventHandlerFactory implements IOEventHandlerFactory {
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingConnPoolListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingConnPoolListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingConnPoolListener.java
deleted file mode 100644
index 901667d..0000000
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingConnPoolListener.java
+++ /dev/null
@@ -1,72 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.core5.testing.nio;
-
-import org.apache.hc.core5.http.HttpHost;
-import org.apache.hc.core5.pool.ConnPoolListener;
-import org.apache.hc.core5.pool.ConnPoolStats;
-import org.apache.hc.core5.pool.PoolStats;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-public class LoggingConnPoolListener implements ConnPoolListener<HttpHost> {
-
- public final static LoggingConnPoolListener INSTANCE = new LoggingConnPoolListener();
-
- private final Logger connLog = LogManager.getLogger("org.apache.hc.core5.http.connection");
-
- private LoggingConnPoolListener() {
- }
-
- @Override
- public void onLease(final HttpHost route, final ConnPoolStats<HttpHost> connPoolStats) {
- if (connLog.isDebugEnabled()) {
- final StringBuilder buf = new StringBuilder();
- buf.append("Leased ").append(route).append(" ");
- final PoolStats totals = connPoolStats.getTotalStats();
- buf.append(" total kept alive: ").append(totals.getAvailable()).append("; ");
- buf.append("total allocated: ").append(totals.getLeased() + totals.getAvailable());
- buf.append(" of ").append(totals.getMax());
- connLog.debug(buf.toString());
- }
- }
-
- @Override
- public void onRelease(final HttpHost route, final ConnPoolStats<HttpHost> connPoolStats) {
- if (connLog.isDebugEnabled()) {
- final StringBuilder buf = new StringBuilder();
- buf.append("Released ").append(route).append(" ");
- final PoolStats totals = connPoolStats.getTotalStats();
- buf.append(" total kept alive: ").append(totals.getAvailable()).append("; ");
- buf.append("total allocated: ").append(totals.getLeased() + totals.getAvailable());
- buf.append(" of ").append(totals.getMax());
- connLog.debug(buf.toString());
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp1StreamListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp1StreamListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp1StreamListener.java
deleted file mode 100644
index 4b0d324..0000000
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp1StreamListener.java
+++ /dev/null
@@ -1,96 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-
-package org.apache.hc.core5.testing.nio;
-
-import java.util.Iterator;
-
-import org.apache.hc.core5.http.Header;
-import org.apache.hc.core5.http.HttpConnection;
-import org.apache.hc.core5.http.HttpRequest;
-import org.apache.hc.core5.http.HttpResponse;
-import org.apache.hc.core5.http.impl.Http1StreamListener;
-import org.apache.hc.core5.http.message.RequestLine;
-import org.apache.hc.core5.http.message.StatusLine;
-import org.apache.logging.log4j.LogManager;
-import org.apache.logging.log4j.Logger;
-
-public class LoggingHttp1StreamListener implements Http1StreamListener {
-
- enum Type { CLIENT, SERVER }
-
- final static LoggingHttp1StreamListener INSTANCE_CLIENT = new LoggingHttp1StreamListener(Type.CLIENT);
- final static LoggingHttp1StreamListener INSTANCE_SERVER = new LoggingHttp1StreamListener(Type.SERVER);
-
- private final Type type;
- private final Logger connLog = LogManager.getLogger("org.apache.hc.core5.http.connection");
- private final Logger headerLog = LogManager.getLogger("org.apache.hc.core5.http.headers");
-
- private LoggingHttp1StreamListener(final Type type) {
- this.type = type;
- }
-
- private String requestDirection() {
- return type == Type.CLIENT ? " >> " : " << ";
- }
-
- private String responseDirection() {
- return type == Type.CLIENT ? " << " : " >> ";
- }
-
- @Override
- public void onRequestHead(final HttpConnection connection, final HttpRequest request) {
- if (headerLog.isDebugEnabled()) {
- headerLog.debug(LoggingSupport.getId(connection) + requestDirection() + new RequestLine(request));
- for (final Iterator<Header> it = request.headerIterator(); it.hasNext(); ) {
- headerLog.debug(LoggingSupport.getId(connection) + requestDirection() + it.next());
- }
- }
- }
-
- @Override
- public void onResponseHead(final HttpConnection connection, final HttpResponse response) {
- if (headerLog.isDebugEnabled()) {
- headerLog.debug(LoggingSupport.getId(connection) + responseDirection() + new StatusLine(response));
- for (final Iterator<Header> it = response.headerIterator(); it.hasNext(); ) {
- headerLog.debug(LoggingSupport.getId(connection) + responseDirection() + it.next());
- }
- }
- }
-
- @Override
- public void onExchangeComplete(final HttpConnection connection, final boolean keepAlive) {
- if (connLog.isDebugEnabled()) {
- if (keepAlive) {
- connLog.debug(LoggingSupport.getId(connection) + " Connection is kept alive");
- } else {
- connLog.debug(LoggingSupport.getId(connection) + " Connection is not kept alive");
- }
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp2StreamListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp2StreamListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp2StreamListener.java
index 84f726f..e3f2122 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp2StreamListener.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingHttp2StreamListener.java
@@ -35,6 +35,7 @@ import org.apache.hc.core5.http.HttpConnection;
import org.apache.hc.core5.http2.frame.FramePrinter;
import org.apache.hc.core5.http2.frame.RawFrame;
import org.apache.hc.core5.http2.impl.nio.Http2StreamListener;
+import org.apache.hc.core5.testing.classic.LoggingSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSessionListener.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSessionListener.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSessionListener.java
index f7d4821..73f8681 100644
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSessionListener.java
+++ b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingIOSessionListener.java
@@ -30,6 +30,7 @@ package org.apache.hc.core5.testing.nio;
import org.apache.hc.core5.http.ConnectionClosedException;
import org.apache.hc.core5.reactor.IOSession;
import org.apache.hc.core5.reactor.IOSessionListener;
+import org.apache.hc.core5.testing.classic.LoggingSupport;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingSupport.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingSupport.java b/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingSupport.java
deleted file mode 100644
index 51fd637..0000000
--- a/httpcore5-testing/src/main/java/org/apache/hc/core5/testing/nio/LoggingSupport.java
+++ /dev/null
@@ -1,44 +0,0 @@
-/*
- * ====================================================================
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- * ====================================================================
- *
- * This software consists of voluntary contributions made by many
- * individuals on behalf of the Apache Software Foundation. For more
- * information on the Apache Software Foundation, please see
- * <http://www.apache.org/>.
- *
- */
-package org.apache.hc.core5.testing.nio;
-
-import org.apache.hc.core5.util.Identifiable;
-
-final class LoggingSupport {
-
- static String getId(final Object object) {
- if (object == null) {
- return null;
- }
- if (object instanceof Identifiable) {
- return ((Identifiable) object).getId();
- } else {
- return object.getClass().getSimpleName() + "-" + Integer.toHexString(System.identityHashCode(object));
- }
- }
-
-}
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
index 9fb4ea5..ba736e4 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http1ServerAndRequesterTest.java
@@ -61,6 +61,8 @@ import org.apache.hc.core5.io.ShutdownType;
import org.apache.hc.core5.reactor.ExceptionEvent;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.reactor.ListenerEndpoint;
+import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.TimeValue;
import org.apache.hc.core5.util.Timeout;
import org.apache.logging.log4j.LogManager;
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ProtocolNegotiationTest.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ProtocolNegotiationTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ProtocolNegotiationTest.java
index 32d062e..98c2c29 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ProtocolNegotiationTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ProtocolNegotiationTest.java
@@ -58,7 +58,9 @@ import org.apache.hc.core5.io.ShutdownType;
import org.apache.hc.core5.reactor.ExceptionEvent;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.reactor.ListenerEndpoint;
+import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
import org.apache.hc.core5.testing.SSLTestContexts;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.Timeout;
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
http://git-wip-us.apache.org/repos/asf/httpcomponents-core/blob/22b30a66/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
----------------------------------------------------------------------
diff --git a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
index 559932e..f7d3a76 100644
--- a/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
+++ b/httpcore5-testing/src/test/java/org/apache/hc/core5/testing/nio/Http2ServerAndRequesterTest.java
@@ -56,6 +56,8 @@ import org.apache.hc.core5.io.ShutdownType;
import org.apache.hc.core5.reactor.ExceptionEvent;
import org.apache.hc.core5.reactor.IOReactorConfig;
import org.apache.hc.core5.reactor.ListenerEndpoint;
+import org.apache.hc.core5.testing.classic.LoggingConnPoolListener;
+import org.apache.hc.core5.testing.classic.LoggingHttp1StreamListener;
import org.apache.hc.core5.util.TimeValue;
import org.apache.hc.core5.util.Timeout;
import org.apache.logging.log4j.LogManager;