@Test public void testClose() { final ClientBuilder builder = ClientBuilder.newBuilder(); final ResteasyClientBuilder clientBuilder = (ResteasyClientBuilder)builder; final ChannelGroup channelGroup = new DefaultChannelGroup(new DefaultEventExecutor()); final ConnectionProvider connectionProvider = ConnectionProvider.fixed(""); final HttpClient httpClient = HttpClient.create() .baseUrl("http: .tcpConfiguration(tcpClient -> tcpClient.doOnConnected(c -> channelGroup.add(c.channel()))); final ReactorNettyClientHttpEngine engine = new ReactorNettyClientHttpEngine( httpClient, channelGroup, connectionProvider); clientBuilder.httpEngine(engine); final Client client = builder.build(); final Response response = client.target("/hello").request().get(); assertEquals(200, response.getStatus()); assertEquals(HELLO_WORLD, response.readEntity(String.class)); engine.close(); assertTrue(channelGroup.isEmpty()); assertTrue(connectionProvider.isDisposed()); }
@Override public void close() { try { channelGroup.close().await(); } catch (InterruptedException e) { log.warn("Exception while closing Netty ChannelGroup", e); } finally { connectionProvider.disposeLater().block(); } }
ReactorNettyClientHttpEngine implements AsyncClientHttpEngine { @Override public void close() { try { channelGroup.close().await(); } catch (InterruptedException e) { log.warn("Exception while closing Netty ChannelGroup", e); } finally { connectionProvider.disposeLater().block(); } } }
ReactorNettyClientHttpEngine implements AsyncClientHttpEngine { @Override public void close() { try { channelGroup.close().await(); } catch (InterruptedException e) { log.warn("Exception while closing Netty ChannelGroup", e); } finally { connectionProvider.disposeLater().block(); } } private  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                         final ChannelGroup channelGroup,
                                         final ConnectionProvider connectionProvider,
                                         final Optional<Duration> requestTimeout,
                                         final Boolean useFinalizedResponse);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Boolean useResponseFinalize);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout,
                                        final Boolean useResponseFinalize); }
ReactorNettyClientHttpEngine implements AsyncClientHttpEngine { @Override public void close() { try { channelGroup.close().await(); } catch (InterruptedException e) { log.warn("Exception while closing Netty ChannelGroup", e); } finally { connectionProvider.disposeLater().block(); } } private  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                         final ChannelGroup channelGroup,
                                         final ConnectionProvider connectionProvider,
                                         final Optional<Duration> requestTimeout,
                                         final Boolean useFinalizedResponse);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Boolean useResponseFinalize);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout,
                                        final Boolean useResponseFinalize); @Override Future<T> submit(final ClientInvocation request,
                                final boolean buffered,
                                final InvocationCallback<T> callback,
                                final ResultExtractor<T> extractor); @Override CompletableFuture<T> submit(final ClientInvocation request,
                                           final boolean buffered,
                                           final ResultExtractor<T> extractor,
                                           final ExecutorService executorService); @Override SSLContext getSslContext(); @Override HostnameVerifier getHostnameVerifier(); @Override Response invoke(Invocation request); @Override void close(); }
ReactorNettyClientHttpEngine implements AsyncClientHttpEngine { @Override public void close() { try { channelGroup.close().await(); } catch (InterruptedException e) { log.warn("Exception while closing Netty ChannelGroup", e); } finally { connectionProvider.disposeLater().block(); } } private  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                         final ChannelGroup channelGroup,
                                         final ConnectionProvider connectionProvider,
                                         final Optional<Duration> requestTimeout,
                                         final Boolean useFinalizedResponse);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Boolean useResponseFinalize);  ReactorNettyClientHttpEngine(final HttpClient httpClient,
                                        final ChannelGroup channelGroup,
                                        final ConnectionProvider connectionProvider,
                                        final Duration requestTimeout,
                                        final Boolean useResponseFinalize); @Override Future<T> submit(final ClientInvocation request,
                                final boolean buffered,
                                final InvocationCallback<T> callback,
                                final ResultExtractor<T> extractor); @Override CompletableFuture<T> submit(final ClientInvocation request,
                                           final boolean buffered,
                                           final ResultExtractor<T> extractor,
                                           final ExecutorService executorService); @Override SSLContext getSslContext(); @Override HostnameVerifier getHostnameVerifier(); @Override Response invoke(Invocation request); @Override void close();  }