.setMaxRequestRetry(0).setShutdownQuietPeriod(0).setShutdownTimeout(0).build();
.setMaxRequestRetry(0).setShutdownQuietPeriod(0).setShutdownTimeout(0).build();
.setMaxRequestRetry(0).setShutdownQuietPeriod(0).setShutdownTimeout(0).build();
/** * A convenience method for creating a StandaloneAhcWSClient from configuration. * * @param ahcWSClientConfig the configuration object * @param cache if not null, will be used for HTTP response caching. * @param materializer an akka materializer * @return a fully configured StandaloneAhcWSClient instance. */ public static StandaloneAhcWSClient create(AhcWSClientConfig ahcWSClientConfig, AhcHttpCache cache, Materializer materializer) { AhcLoggerFactory loggerFactory = new AhcLoggerFactory(LoggerFactory.getILoggerFactory()); // Set up debugging configuration if (ahcWSClientConfig.wsClientConfig().ssl().debug().enabled()) { new DebugConfiguration(loggerFactory).configure(ahcWSClientConfig.wsClientConfig().ssl().debug()); } // Configure the AsyncHttpClientConfig.Builder from the application.conf file... final AhcConfigBuilder builder = new AhcConfigBuilder(ahcWSClientConfig); final DefaultAsyncHttpClientConfig.Builder ahcBuilder = builder.configure(); // Set up SSL configuration settings that are global.. new SystemConfiguration(loggerFactory).configure(ahcWSClientConfig.wsClientConfig().ssl()); // Create the AHC asyncHttpClient DefaultAsyncHttpClientConfig asyncHttpClientConfig = ahcBuilder.build(); DefaultAsyncHttpClient defaultAsyncHttpClient = new DefaultAsyncHttpClient(asyncHttpClientConfig); AsyncHttpClient ahcClient; if (cache != null) { ahcClient = new CachingAsyncHttpClient(defaultAsyncHttpClient, cache); } else { ahcClient = defaultAsyncHttpClient; } return new StandaloneAhcWSClient(ahcClient, materializer); }
/** * A convenience method for creating a StandaloneAhcWSClient from configuration. * * @param ahcWSClientConfig the configuration object * @param cache if not null, will be used for HTTP response caching. * @param materializer an akka materializer * @return a fully configured StandaloneAhcWSClient instance. */ public static StandaloneAhcWSClient create(AhcWSClientConfig ahcWSClientConfig, AhcHttpCache cache, Materializer materializer) { AhcLoggerFactory loggerFactory = new AhcLoggerFactory(LoggerFactory.getILoggerFactory()); // Set up debugging configuration if (ahcWSClientConfig.wsClientConfig().ssl().debug().enabled()) { new DebugConfiguration(loggerFactory).configure(ahcWSClientConfig.wsClientConfig().ssl().debug()); } // Configure the AsyncHttpClientConfig.Builder from the application.conf file... final AhcConfigBuilder builder = new AhcConfigBuilder(ahcWSClientConfig); final DefaultAsyncHttpClientConfig.Builder ahcBuilder = builder.configure(); // Set up SSL configuration settings that are global.. new SystemConfiguration(loggerFactory).configure(ahcWSClientConfig.wsClientConfig().ssl()); // Create the AHC asyncHttpClient DefaultAsyncHttpClientConfig asyncHttpClientConfig = ahcBuilder.build(); DefaultAsyncHttpClient defaultAsyncHttpClient = new DefaultAsyncHttpClient(asyncHttpClientConfig); AsyncHttpClient ahcClient; if (cache != null) { ahcClient = new CachingAsyncHttpClient(defaultAsyncHttpClient, cache); } else { ahcClient = defaultAsyncHttpClient; } return new StandaloneAhcWSClient(ahcClient, materializer); }