Search in sources :

Example 11 with HttpAsyncRequester

use of org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester in project httpcomponents-core by apache.

the class HttpBenchmark method execute.

public Results execute() throws Exception {
    final HttpProcessorBuilder builder = HttpProcessorBuilder.create().addAll(new H2RequestContent(), new H2RequestTargetHost(), new H2RequestConnControl(), new RequestUserAgent("HttpCore-AB/5.0"));
    if (this.config.isUseExpectContinue()) {
        builder.add(new RequestExpectContinue());
    }
    final SSLContext sslContext;
    if ("https".equals(config.getUri().getScheme())) {
        final SSLContextBuilder sslContextBuilder = new SSLContextBuilder();
        sslContextBuilder.setProtocol("SSL");
        if (config.isDisableSSLVerification()) {
            sslContextBuilder.loadTrustMaterial(null, (chain, authType) -> true);
        } else if (config.getTrustStorePath() != null) {
            sslContextBuilder.loadTrustMaterial(new File(config.getTrustStorePath()), config.getTrustStorePassword() != null ? config.getTrustStorePassword().toCharArray() : null);
        }
        if (config.getIdentityStorePath() != null) {
            sslContextBuilder.loadKeyMaterial(Paths.get(config.getIdentityStorePath()), config.getIdentityStorePassword() != null ? config.getIdentityStorePassword().toCharArray() : null, config.getIdentityStorePassword() != null ? config.getIdentityStorePassword().toCharArray() : null);
        }
        sslContext = sslContextBuilder.build();
    } else {
        sslContext = SSLContexts.createSystemDefault();
    }
    final HttpVersionPolicy versionPolicy;
    if (config.isForceHttp2()) {
        versionPolicy = HttpVersionPolicy.FORCE_HTTP_2;
    } else {
        if (sslContext != null) {
            versionPolicy = HttpVersionPolicy.NEGOTIATE;
        } else {
            versionPolicy = HttpVersionPolicy.FORCE_HTTP_1;
        }
    }
    final Stats stats = new Stats();
    try (final HttpAsyncRequester requester = H2RequesterBootstrap.bootstrap().setHttpProcessor(builder.build()).setTlsStrategy(new BasicClientTlsStrategy(sslContext)).setVersionPolicy(versionPolicy).setH2Config(H2Config.custom().setPushEnabled(false).build()).setIOSessionDecorator(ioSession -> new IOSession() {

        @Override
        public String getId() {
            return ioSession.getId();
        }

        @Override
        public Lock getLock() {
            return ioSession.getLock();
        }

        @Override
        public void enqueue(final Command command, final Command.Priority priority) {
            ioSession.enqueue(command, priority);
        }

        @Override
        public boolean hasCommands() {
            return ioSession.hasCommands();
        }

        @Override
        public Command poll() {
            return ioSession.poll();
        }

        @Override
        public ByteChannel channel() {
            return ioSession.channel();
        }

        @Override
        public SocketAddress getRemoteAddress() {
            return ioSession.getRemoteAddress();
        }

        @Override
        public SocketAddress getLocalAddress() {
            return ioSession.getLocalAddress();
        }

        @Override
        public int getEventMask() {
            return ioSession.getEventMask();
        }

        @Override
        public void setEventMask(final int ops) {
            ioSession.setEventMask(ops);
        }

        @Override
        public void setEvent(final int op) {
            ioSession.setEvent(op);
        }

        @Override
        public void clearEvent(final int op) {
            ioSession.clearEvent(op);
        }

        @Override
        public void close() {
            ioSession.close();
        }

        @Override
        public Status getStatus() {
            return ioSession.getStatus();
        }

        @Override
        public int read(final ByteBuffer dst) throws IOException {
            final int bytesRead = ioSession.read(dst);
            if (bytesRead > 0) {
                stats.incTotalBytesRecv(bytesRead);
            }
            return bytesRead;
        }

        @Override
        public int write(final ByteBuffer src) throws IOException {
            final int bytesWritten = ioSession.write(src);
            if (bytesWritten > 0) {
                stats.incTotalBytesSent(bytesWritten);
            }
            return bytesWritten;
        }

        @Override
        public boolean isOpen() {
            return ioSession.isOpen();
        }

        @Override
        public Timeout getSocketTimeout() {
            return ioSession.getSocketTimeout();
        }

        @Override
        public void setSocketTimeout(final Timeout timeout) {
            ioSession.setSocketTimeout(timeout);
        }

        @Override
        public long getLastReadTime() {
            return ioSession.getLastReadTime();
        }

        @Override
        public long getLastWriteTime() {
            return ioSession.getLastWriteTime();
        }

        @Override
        public long getLastEventTime() {
            return ioSession.getLastEventTime();
        }

        @Override
        public void updateReadTime() {
            ioSession.updateReadTime();
        }

        @Override
        public void updateWriteTime() {
            ioSession.updateWriteTime();
        }

        @Override
        public void close(final CloseMode closeMode) {
            ioSession.close(closeMode);
        }

        @Override
        public IOEventHandler getHandler() {
            return ioSession.getHandler();
        }

        @Override
        public void upgrade(final IOEventHandler handler) {
            ioSession.upgrade(handler);
        }
    }).setStreamListener(new Http1StreamListener() {

        @Override
        public void onRequestHead(final HttpConnection connection, final HttpRequest request) {
            if (config.getVerbosity() >= 3) {
                System.out.println(">> " + request.getMethod() + " " + request.getRequestUri());
                final Header[] headers = request.getHeaders();
                for (final Header header : headers) {
                    System.out.println(">> " + header);
                }
                System.out.println();
            }
        }

        @Override
        public void onResponseHead(final HttpConnection connection, final HttpResponse response) {
            if (config.getVerbosity() >= 3) {
                System.out.println("<< " + response.getCode() + " " + response.getReasonPhrase());
                final Header[] headers = response.getHeaders();
                for (final Header header : headers) {
                    System.out.println("<< " + header);
                }
                System.out.println();
            }
        }

        @Override
        public void onExchangeComplete(final HttpConnection connection, final boolean keepAlive) {
        }
    }).setStreamListener(new H2StreamListener() {

        private final FramePrinter framePrinter = new FramePrinter();

        @Override
        public void onHeaderInput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            if (config.getVerbosity() >= 3) {
                for (final Header header : headers) {
                    System.out.println("<< " + header);
                }
                System.out.println();
            }
        }

        @Override
        public void onHeaderOutput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            if (config.getVerbosity() >= 3) {
                for (final Header header : headers) {
                    System.out.println(">> " + header);
                }
                System.out.println();
            }
        }

        @Override
        public void onFrameInput(final HttpConnection connection, final int streamId, final RawFrame frame) {
            if (config.getVerbosity() >= 4) {
                System.out.print("<< ");
                try {
                    framePrinter.printFrameInfo(frame, System.out);
                    System.out.println();
                    if (!frame.isType(FrameType.DATA)) {
                        framePrinter.printPayload(frame, System.out);
                        System.out.println();
                    }
                } catch (final IOException ignore) {
                }
            }
        }

        @Override
        public void onFrameOutput(final HttpConnection connection, final int streamId, final RawFrame frame) {
            if (config.getVerbosity() >= 4) {
                System.out.print(">> ");
                try {
                    framePrinter.printFrameInfo(frame, System.out);
                    System.out.println();
                    if (!frame.isType(FrameType.DATA)) {
                        framePrinter.printPayload(frame, System.out);
                        System.out.println();
                    }
                } catch (final IOException ignore) {
                }
            }
        }

        @Override
        public void onInputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
            if (config.getVerbosity() >= 5) {
                System.out.println("<< stream " + streamId + ": " + actualSize + " " + delta);
            }
        }

        @Override
        public void onOutputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
            if (config.getVerbosity() >= 5) {
                System.out.println(">> stream " + streamId + ": " + actualSize + " " + delta);
            }
        }
    }).setIOReactorConfig(IOReactorConfig.custom().setSoTimeout(config.getSocketTimeout()).build()).create()) {
        requester.setDefaultMaxPerRoute(config.getConcurrencyLevel());
        requester.setMaxTotal(config.getConcurrencyLevel() * 2);
        requester.start();
        return doExecute(requester, stats);
    }
}
Also used : HttpConnection(org.apache.hc.core5.http.HttpConnection) Http1StreamListener(org.apache.hc.core5.http.impl.Http1StreamListener) H2RequestContent(org.apache.hc.core5.http2.protocol.H2RequestContent) H2RequestConnControl(org.apache.hc.core5.http2.protocol.H2RequestConnControl) H2StreamListener(org.apache.hc.core5.http2.impl.nio.H2StreamListener) HttpVersionPolicy(org.apache.hc.core5.http2.HttpVersionPolicy) IOSession(org.apache.hc.core5.reactor.IOSession) HttpAsyncRequester(org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester) SocketAddress(java.net.SocketAddress) SSLContextBuilder(org.apache.hc.core5.ssl.SSLContextBuilder) HttpRequest(org.apache.hc.core5.http.HttpRequest) FramePrinter(org.apache.hc.core5.http2.frame.FramePrinter) RequestExpectContinue(org.apache.hc.core5.http.protocol.RequestExpectContinue) RequestUserAgent(org.apache.hc.core5.http.protocol.RequestUserAgent) Timeout(org.apache.hc.core5.util.Timeout) HttpResponse(org.apache.hc.core5.http.HttpResponse) SSLContext(javax.net.ssl.SSLContext) IOException(java.io.IOException) ByteBuffer(java.nio.ByteBuffer) Lock(java.util.concurrent.locks.Lock) IOEventHandler(org.apache.hc.core5.reactor.IOEventHandler) HttpProcessorBuilder(org.apache.hc.core5.http.protocol.HttpProcessorBuilder) ByteChannel(java.nio.channels.ByteChannel) BasicClientTlsStrategy(org.apache.hc.core5.http.nio.ssl.BasicClientTlsStrategy) Header(org.apache.hc.core5.http.Header) Command(org.apache.hc.core5.reactor.Command) CloseMode(org.apache.hc.core5.io.CloseMode) RawFrame(org.apache.hc.core5.http2.frame.RawFrame) H2RequestTargetHost(org.apache.hc.core5.http2.protocol.H2RequestTargetHost) File(java.io.File)

Example 12 with HttpAsyncRequester

use of org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester in project httpcomponents-core by apache.

the class H2ConscriptRequestExecutionExample method main.

public static void main(final String[] args) throws Exception {
    // Create and start requester
    final H2Config h2Config = H2Config.custom().setPushEnabled(false).build();
    final SSLContext sslContext = SSLContexts.custom().setProvider(Conscrypt.newProvider()).build();
    final HttpAsyncRequester requester = H2RequesterBootstrap.bootstrap().setH2Config(h2Config).setTlsStrategy(new ConscryptClientTlsStrategy(sslContext)).setStreamListener(new H2StreamListener() {

        @Override
        public void onHeaderInput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") << " + headers.get(i));
            }
        }

        @Override
        public void onHeaderOutput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") >> " + headers.get(i));
            }
        }

        @Override
        public void onFrameInput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onFrameOutput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onInputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }

        @Override
        public void onOutputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }
    }).create();
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        System.out.println("HTTP requester shutting down");
        requester.close(CloseMode.GRACEFUL);
    }));
    requester.start();
    final HttpHost target = new HttpHost("https", "nghttp2.org", 443);
    final String[] requestUris = new String[] { "/httpbin/ip", "/httpbin/user-agent", "/httpbin/headers" };
    final CountDownLatch latch = new CountDownLatch(requestUris.length);
    for (final String requestUri : requestUris) {
        final Future<AsyncClientEndpoint> future = requester.connect(target, Timeout.ofDays(5));
        final AsyncClientEndpoint clientEndpoint = future.get();
        clientEndpoint.execute(AsyncRequestBuilder.get().setHttpHost(target).setPath(requestUri).build(), new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), new FutureCallback<Message<HttpResponse, String>>() {

            @Override
            public void completed(final Message<HttpResponse, String> message) {
                clientEndpoint.releaseAndReuse();
                final HttpResponse response = message.getHead();
                final String body = message.getBody();
                System.out.println(requestUri + "->" + response.getCode() + " " + response.getVersion());
                System.out.println(body);
                latch.countDown();
            }

            @Override
            public void failed(final Exception ex) {
                clientEndpoint.releaseAndDiscard();
                System.out.println(requestUri + "->" + ex);
                latch.countDown();
            }

            @Override
            public void cancelled() {
                clientEndpoint.releaseAndDiscard();
                System.out.println(requestUri + " cancelled");
                latch.countDown();
            }
        });
    }
    latch.await();
    System.out.println("Shutting down I/O reactor");
    requester.initiateShutdown();
}
Also used : Message(org.apache.hc.core5.http.Message) HttpConnection(org.apache.hc.core5.http.HttpConnection) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) H2StreamListener(org.apache.hc.core5.http2.impl.nio.H2StreamListener) HttpHost(org.apache.hc.core5.http.HttpHost) List(java.util.List) HttpAsyncRequester(org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester) StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) HttpResponse(org.apache.hc.core5.http.HttpResponse) SSLContext(javax.net.ssl.SSLContext) CountDownLatch(java.util.concurrent.CountDownLatch) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) ConscryptClientTlsStrategy(org.apache.hc.core5.http2.ssl.ConscryptClientTlsStrategy) Header(org.apache.hc.core5.http.Header) RawFrame(org.apache.hc.core5.http2.frame.RawFrame) H2Config(org.apache.hc.core5.http2.config.H2Config)

Example 13 with HttpAsyncRequester

use of org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester in project httpcomponents-core by apache.

the class H2MultiStreamExecutionExample method main.

public static void main(final String[] args) throws Exception {
    // Create and start requester
    final IOReactorConfig ioReactorConfig = IOReactorConfig.custom().setSoTimeout(5, TimeUnit.SECONDS).build();
    final H2Config h2Config = H2Config.custom().setPushEnabled(false).setMaxConcurrentStreams(100).build();
    final HttpAsyncRequester requester = H2RequesterBootstrap.bootstrap().setIOReactorConfig(ioReactorConfig).setVersionPolicy(HttpVersionPolicy.FORCE_HTTP_2).setH2Config(h2Config).setStreamListener(new H2StreamListener() {

        @Override
        public void onHeaderInput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") << " + headers.get(i));
            }
        }

        @Override
        public void onHeaderOutput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") >> " + headers.get(i));
            }
        }

        @Override
        public void onFrameInput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onFrameOutput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onInputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }

        @Override
        public void onOutputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }
    }).create();
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        System.out.println("HTTP requester shutting down");
        requester.close(CloseMode.GRACEFUL);
    }));
    requester.start();
    final HttpHost target = new HttpHost("nghttp2.org");
    final String[] requestUris = new String[] { "/httpbin/ip", "/httpbin/user-agent", "/httpbin/headers" };
    final Future<AsyncClientEndpoint> future = requester.connect(target, Timeout.ofSeconds(5));
    final AsyncClientEndpoint clientEndpoint = future.get();
    final CountDownLatch latch = new CountDownLatch(requestUris.length);
    for (final String requestUri : requestUris) {
        clientEndpoint.execute(AsyncRequestBuilder.get().setHttpHost(target).setPath(requestUri).build(), new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), new FutureCallback<Message<HttpResponse, String>>() {

            @Override
            public void completed(final Message<HttpResponse, String> message) {
                latch.countDown();
                final HttpResponse response = message.getHead();
                final String body = message.getBody();
                System.out.println(requestUri + "->" + response.getCode());
                System.out.println(body);
            }

            @Override
            public void failed(final Exception ex) {
                latch.countDown();
                System.out.println(requestUri + "->" + ex);
            }

            @Override
            public void cancelled() {
                latch.countDown();
                System.out.println(requestUri + " cancelled");
            }
        });
    }
    latch.await();
    // Manually release client endpoint when done !!!
    clientEndpoint.releaseAndDiscard();
    System.out.println("Shutting down I/O reactor");
    requester.initiateShutdown();
}
Also used : StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) Message(org.apache.hc.core5.http.Message) HttpConnection(org.apache.hc.core5.http.HttpConnection) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) HttpResponse(org.apache.hc.core5.http.HttpResponse) CountDownLatch(java.util.concurrent.CountDownLatch) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) IOReactorConfig(org.apache.hc.core5.reactor.IOReactorConfig) H2StreamListener(org.apache.hc.core5.http2.impl.nio.H2StreamListener) Header(org.apache.hc.core5.http.Header) HttpHost(org.apache.hc.core5.http.HttpHost) RawFrame(org.apache.hc.core5.http2.frame.RawFrame) List(java.util.List) H2Config(org.apache.hc.core5.http2.config.H2Config) HttpAsyncRequester(org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester)

Example 14 with HttpAsyncRequester

use of org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester in project httpcomponents-core by apache.

the class H2TlsAlpnRequestExecutionExample method main.

public static void main(final String[] args) throws Exception {
    // Create and start requester
    final H2Config h2Config = H2Config.custom().setPushEnabled(false).build();
    final HttpAsyncRequester requester = H2RequesterBootstrap.bootstrap().setH2Config(h2Config).setTlsStrategy(new H2ClientTlsStrategy(SSLContexts.createSystemDefault(), (endpoint, sslEngine) -> {
        // ====
        return null;
    })).setStreamListener(new H2StreamListener() {

        @Override
        public void onHeaderInput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") << " + headers.get(i));
            }
        }

        @Override
        public void onHeaderOutput(final HttpConnection connection, final int streamId, final List<? extends Header> headers) {
            for (int i = 0; i < headers.size(); i++) {
                System.out.println(connection.getRemoteAddress() + " (" + streamId + ") >> " + headers.get(i));
            }
        }

        @Override
        public void onFrameInput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onFrameOutput(final HttpConnection connection, final int streamId, final RawFrame frame) {
        }

        @Override
        public void onInputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }

        @Override
        public void onOutputFlowControl(final HttpConnection connection, final int streamId, final int delta, final int actualSize) {
        }
    }).create();
    Runtime.getRuntime().addShutdownHook(new Thread(() -> {
        System.out.println("HTTP requester shutting down");
        requester.close(CloseMode.GRACEFUL);
    }));
    requester.start();
    final HttpHost target = new HttpHost("https", "nghttp2.org", 443);
    final String[] requestUris = new String[] { "/httpbin/ip", "/httpbin/user-agent", "/httpbin/headers" };
    final CountDownLatch latch = new CountDownLatch(requestUris.length);
    for (final String requestUri : requestUris) {
        final Future<AsyncClientEndpoint> future = requester.connect(target, Timeout.ofSeconds(5));
        final AsyncClientEndpoint clientEndpoint = future.get();
        clientEndpoint.execute(AsyncRequestBuilder.get().setHttpHost(target).setPath(requestUri).build(), new BasicResponseConsumer<>(new StringAsyncEntityConsumer()), new FutureCallback<Message<HttpResponse, String>>() {

            @Override
            public void completed(final Message<HttpResponse, String> message) {
                clientEndpoint.releaseAndReuse();
                final HttpResponse response = message.getHead();
                final String body = message.getBody();
                System.out.println(requestUri + "->" + response.getCode() + " " + response.getVersion());
                System.out.println(body);
                latch.countDown();
            }

            @Override
            public void failed(final Exception ex) {
                clientEndpoint.releaseAndDiscard();
                System.out.println(requestUri + "->" + ex);
                latch.countDown();
            }

            @Override
            public void cancelled() {
                clientEndpoint.releaseAndDiscard();
                System.out.println(requestUri + " cancelled");
                latch.countDown();
            }
        });
    }
    latch.await();
    System.out.println("Shutting down I/O reactor");
    requester.initiateShutdown();
}
Also used : RawFrame(org.apache.hc.core5.http2.frame.RawFrame) Message(org.apache.hc.core5.http.Message) SSLContexts(org.apache.hc.core5.ssl.SSLContexts) H2Config(org.apache.hc.core5.http2.config.H2Config) AsyncRequestBuilder(org.apache.hc.core5.http.nio.support.AsyncRequestBuilder) H2RequesterBootstrap(org.apache.hc.core5.http2.impl.nio.bootstrap.H2RequesterBootstrap) Header(org.apache.hc.core5.http.Header) BasicResponseConsumer(org.apache.hc.core5.http.nio.support.BasicResponseConsumer) StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) Timeout(org.apache.hc.core5.util.Timeout) CountDownLatch(java.util.concurrent.CountDownLatch) List(java.util.List) Future(java.util.concurrent.Future) HttpHost(org.apache.hc.core5.http.HttpHost) HttpConnection(org.apache.hc.core5.http.HttpConnection) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) H2StreamListener(org.apache.hc.core5.http2.impl.nio.H2StreamListener) HttpAsyncRequester(org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester) CloseMode(org.apache.hc.core5.io.CloseMode) FutureCallback(org.apache.hc.core5.concurrent.FutureCallback) HttpResponse(org.apache.hc.core5.http.HttpResponse) H2ClientTlsStrategy(org.apache.hc.core5.http2.ssl.H2ClientTlsStrategy) Message(org.apache.hc.core5.http.Message) HttpConnection(org.apache.hc.core5.http.HttpConnection) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) H2StreamListener(org.apache.hc.core5.http2.impl.nio.H2StreamListener) HttpHost(org.apache.hc.core5.http.HttpHost) H2ClientTlsStrategy(org.apache.hc.core5.http2.ssl.H2ClientTlsStrategy) List(java.util.List) HttpAsyncRequester(org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester) StringAsyncEntityConsumer(org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer) HttpResponse(org.apache.hc.core5.http.HttpResponse) CountDownLatch(java.util.concurrent.CountDownLatch) AsyncClientEndpoint(org.apache.hc.core5.http.nio.AsyncClientEndpoint) Header(org.apache.hc.core5.http.Header) RawFrame(org.apache.hc.core5.http2.frame.RawFrame) H2Config(org.apache.hc.core5.http2.config.H2Config)

Aggregations

HttpConnection (org.apache.hc.core5.http.HttpConnection)12 HttpResponse (org.apache.hc.core5.http.HttpResponse)12 HttpAsyncRequester (org.apache.hc.core5.http.impl.bootstrap.HttpAsyncRequester)12 CountDownLatch (java.util.concurrent.CountDownLatch)10 HttpHost (org.apache.hc.core5.http.HttpHost)10 Header (org.apache.hc.core5.http.Header)9 StringAsyncEntityConsumer (org.apache.hc.core5.http.nio.entity.StringAsyncEntityConsumer)9 List (java.util.List)7 HttpRequest (org.apache.hc.core5.http.HttpRequest)7 Message (org.apache.hc.core5.http.Message)7 Http1StreamListener (org.apache.hc.core5.http.impl.Http1StreamListener)7 AsyncClientEndpoint (org.apache.hc.core5.http.nio.AsyncClientEndpoint)7 RawFrame (org.apache.hc.core5.http2.frame.RawFrame)7 H2StreamListener (org.apache.hc.core5.http2.impl.nio.H2StreamListener)7 H2Config (org.apache.hc.core5.http2.config.H2Config)6 IOReactorConfig (org.apache.hc.core5.reactor.IOReactorConfig)6 RequestLine (org.apache.hc.core5.http.message.RequestLine)5 StatusLine (org.apache.hc.core5.http.message.StatusLine)5 URI (java.net.URI)4 ByteBuffer (java.nio.ByteBuffer)4