I have a web service which in one of its web methods creates two threads and calls two more web service for inserting data. Now, my original web service is expected to receive calls in range of 1,000 to 10,000 in parallel. So you may understand that for each such call internally my web service is going to create two more threads. I have already tuned my application server for such heavy load. trust me.
I used Executor with fixed thread pool size using future objects in my original web service but i found that the calls made to the other two web services seem to be processed sequentially. I have checked all tutorials/code snippets. My code seems correct.
ExecutorService executor = Executors.newFixedThreadPool(size);
Future<Boolean> futureOne = executor.submit(new MyThread(serviceOne, data));
Future<Boolean> futureTwo = executor.submit(new MyThread(serviceTwo, data));
bSuccessfulOne = futureOne.get();
bSuccessfulTwo = futureTwo.get();
In view of the first para that i wrote is there any multithreading/job parallel framework/just some common-sense programming that might help process these web service calls in parallel. If any, please suggest.