Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6391235
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T03:38:50+00:00 2026-05-25T03:38:50+00:00

I’m just porting some code over from .net to Java. I’ve been using the

  • 0

I’m just porting some code over from .net to Java. I’ve been using the AsyncHttpClient (https://github.com/sonatype/async-http-client) library with the Netty provider.

Doing a little bit of testing I was surprised to see that during the execute call e.g:

httpClient.prepareGet("http://bbc.co.uk").execute(
                  new AsyncCompletionHandler<Response>() { ... });

The NettyAsyncHttpProvider performs a bootstrap connect to the site i.e.:

bootstrap.connect(new InetSocketAddress(
                                        AsyncHttpProviderUtils.getHost(uri), 
                                        AsyncHttpProviderUtils.getPort(uri)));

EDIT: to clarify the NettyAsyncHttpProvider class is part of the AsyncHttpClient Library. It has nothing to do with Netty itself.

Which means on something like the bbc website (on my lowly connection) it takes about 300ms for the execute to complete (then the async receive/complete happens almost immediately). This really kills the performance of my dispatcher which is trying to start multiple async calls. When each call is to the same domain it works well. In my situation I have hundreds of different domains so each call incurs the initial delay while the connection is established which kills the throughput of the dispatcher.

Can anyone offer any advice on how to use this library so it truly works in an async fashion or an alternative library?

Thanks,
Paul

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T03:38:51+00:00Added an answer on May 25, 2026 at 3:38 am

    To answer my own question…in the end I tried the original AsyncHttpClient library, Jetty and the Apache HttpAsyncClient (http://hc.apache.org/httpcomponents-asyncclient-dev/index.html) to try and find a library that is 100% asynchronous.

    As far as I can tell each of these libraries performs a blocking connect before performing the actual http request asynchronously.

    In order to move forward I’ve gone with executing each http request in its own thread. I’ve followed the pattern outlined in section “2.9. Multithreaded request execution” (http://hc.apache.org/httpcomponents-client-ga/tutorial/html/connmgmt.html) that details how to use this approach.

    This approach is now working well and allows the my “dispatcher” to rapidly create numerous async calls without having any blocking in the main thread.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
For some reason, after submitting a string like this Jack’s Spindle from a text
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I have thousands of HTML files to process using Groovy/Java and I need to
link Im having trouble converting the html entites into html characters, (&# 8217;) i
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a jquery bug and I've been looking for hours now, I can't
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
I'm using v2.0 of ClassTextile.php, with the following call: $testimonial_text = $textile->TextileRestricted($_POST['testimonial']); ... and
I am currently running into a problem where an element is coming back from

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.