This week's book giveaway is in the Cloud/Virtualization forum.
We're giving away four copies of Building Blockchain Apps and have Michael Yuan on-line!
See this thread for details.
Win a copy of Building Blockchain Apps this week in the Cloud/Virtualization forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Liutauras Vilda
  • Knute Snortum
  • Bear Bibeault
Sheriffs:
  • Devaka Cooray
  • Jeanne Boyarsky
  • Junilu Lacar
Saloon Keepers:
  • Ron McLeod
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
  • salvin francis
Bartenders:
  • Tim Holloway
  • Piet Souris
  • Frits Walraven

How to limit webservice calls suppose 50 at a time while invoking webservice client.

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How to limit web service calls suppose 50 at a time while invoking webservice client?
 
Author and all-around good cowpoke
Posts: 13078
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
IF you are talking about simultaneous server requests, in Tomcat this is a straightforward setting for the number of request threads and number of pending requests allowed.

IF you are talking about one webservice client making 50 requests, that is a client side programming problem.

Bill
 
anshu bajpai
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need the client side sample code where a singleton class (with 50 thread instances )is invoking the client stub method of a particular web service.
 
Ranch Hand
Posts: 268
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Message deleted....
 
Ranch Hand
Posts: 2198
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi!
Take a look at java.util.concurrent.ThreadPoolExecutor.
1) If you need max 50 threads at the same time to invoke a web service, then set the number of threads in the executor to 50.
2) If you need to limit the total number of invocations of the web service to 50, then create a subclass of ThreadPoolExecutor in which you override the execute method. In your execute method, you check if the total number of submitted tasks is less than 50, before accepting a new task.
Best wishes!
 
I do some of my very best work in water. Like this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!