Question: In a webapp, we have to call a Webservice with Input as N(100) number so that the webservice would get the responses from the queue. Once I get the 100 responses I have to divide it in 5 threads and divide this responses accordingly (20 each) for each thread. And once the processing of the thread is done, it should again call the webservice.
I have the webservice which would return responses depending on the Input number but I don't know what technology I should use to implement the other part.
I have researched on following:
Spring Task Execution: http://static.springsource.org/spring/docs/3.0.x/reference/scheduling.html - but this won't fit as I can't specify how many threads I need to start.
Partitioning: section7.4: http://static.springsource.org/spring-batch/reference/html/scalability.html - I just came across this but haven't worked with this earlier.
It would be great if any one of you could guide me in the right direction.
This is my first post so I apologize if there are any mistakes.
Update: 11/21/2012: I have implemented with the ThreadPoolTaskExecutor. I will post my code snippet after the vacation. But one thing that bugs me is I have to divide the 100 results into group of 20 and have the taskExecutor.submit(); in the For Loop to loop for 5 times which would create 5 threads. It would be nice to have a straight forward way where I submit this 100 requests and can choose how many threads I would like to spawn.
Happy ThanksGiving guys. will update the post after holidays