Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Jakarta Commons Httpclient multi-threading problem  RSS feed

 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have a client which is able to create multiple threads, each thread sends a POST. I am able to run up to 50 threads with out a problem with my current version of the client. I want to use Httpclient but this version of the client code give an error which says:

I don't generate this error and don't know where it is coming from, or what is generating it. The threads write their output to output files, each thread has its own output file. I get one of these errors for each thread I run over 10. So if I run 15 threads I get 4 of these messages. The only major differance between the two versions of the clients is the Httpclient code. The other strange thing is that all of the threads run successfully, and the output files contain the correct data.
 
William Barnes
Ranch Hand
Posts: 1049
2
IntelliJ IDE Java Spring
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It appears I was not using the "multithreaded" connection manager. The default connection manager don't do multithreading good.
Jakarta Commons Httpclient MultithreadedHttpConnectionManager documentation
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!