Tabnine Logo
HttpConfig.getMaxConnectionsPerHost
Code IndexAdd Tabnine to your IDE (free)

How to use
getMaxConnectionsPerHost
method
in
com.hubspot.horizon.HttpConfig

Best Java code snippets using com.hubspot.horizon.HttpConfig.getMaxConnectionsPerHost (Showing top 2 results out of 315)

origin: com.hubspot/HorizonApache

private HttpClientConnectionManager createConnectionManager(HttpConfig config) {
 Registry<ConnectionSocketFactory> registry = createSocketFactoryRegistry(config);
 PoolingHttpClientConnectionManager connectionManager = new PoolingHttpClientConnectionManager(registry);
 connectionManager.setMaxTotal(config.getMaxConnections());
 connectionManager.setDefaultMaxPerRoute(config.getMaxConnectionsPerHost());
 return connectionManager;
}
origin: com.hubspot/HorizonNing

public NingAsyncHttpClient(HttpConfig config) {
 Preconditions.checkNotNull(config);
 NettyAsyncHttpProviderConfig nettyConfig = new NettyAsyncHttpProviderConfig();
 int workerThreads = Math.min(Runtime.getRuntime().availableProcessors(), 4);
 this.workerExecutorService = newWorkerThreadPool(workerThreads);
 this.channelFactory = newSocketChannelFactory(this.workerExecutorService, workerThreads);
 nettyConfig.setSocketChannelFactory(this.channelFactory);
 nettyConfig.setNettyTimer(TIMER);
 AsyncHttpClientConfig ningConfig = new AsyncHttpClientConfig.Builder()
     .addRequestFilter(new ThrottleRequestFilter(config.getMaxConnections()))
     .addRequestFilter(new AcceptEncodingRequestFilter())
     .setMaxConnectionsPerHost(config.getMaxConnectionsPerHost())
     .setConnectTimeout(config.getConnectTimeoutMillis())
     .setRequestTimeout(config.getRequestTimeoutMillis())
     .setReadTimeout(config.getRequestTimeoutMillis())
     .setMaxRedirects(config.getMaxRedirects())
     .setFollowRedirect(config.isFollowRedirects())
     .setHostnameVerifier(new NingHostnameVerifier(config.getSSLConfig()))
     .setSSLContext(NingSSLContext.forConfig(config.getSSLConfig()))
     .setAsyncHttpClientProviderConfig(nettyConfig)
     .setUserAgent(config.getUserAgent())
     .setIOThreadMultiplier(1)
     .build();
 this.ningClient = new com.ning.http.client.AsyncHttpClient(ningConfig);
 this.requestConverter = new NingHttpRequestConverter(config.getObjectMapper());
 this.defaultOptions = config.getOptions();
 this.mapper = config.getObjectMapper();
}
com.hubspot.horizonHttpConfiggetMaxConnectionsPerHost

Popular methods of HttpConfig

  • newBuilder
  • getConnectTimeoutMillis
  • getMaxConnections
  • getMaxRedirects
  • getObjectMapper
  • getOptions
  • getRequestTimeoutMillis
  • getSSLConfig
  • getUserAgent
  • isFollowRedirects
  • <init>
  • getDefaultKeepAliveMillis
  • <init>,
  • getDefaultKeepAliveMillis,
  • isRejectRelativeRedirects

Popular in Java

  • Creating JSON documents from java classes using gson
  • getSupportFragmentManager (FragmentActivity)
  • notifyDataSetChanged (ArrayAdapter)
  • findViewById (Activity)
  • PrintWriter (java.io)
    Wraps either an existing OutputStream or an existing Writerand provides convenience methods for prin
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • JPanel (javax.swing)
  • FileUtils (org.apache.commons.io)
    General file manipulation utilities. Facilities are provided in the following areas: * writing to a
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now