Skip to main content
AI Assist is now on Stack Overflow. Start a chat to get instant answers from across the network. Sign up to save and share your chats.
Spring is not part of Java EE.
Link
BalusC
  • 1.1m
  • 377
  • 3.7k
  • 3.6k

Java EE: Multi-threading and Parallel Processing in Webapplication - Advise needed

added 501 characters in body
Source Link
John
  • 121
  • 6
  • 18

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:

  1. 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.

  2. 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

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:

  1. 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.

  2. 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.

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:

  1. 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.

  2. 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

edited title
Link
Arjan Tijms
  • 38.2k
  • 12
  • 112
  • 144

J2EE Java EE: Multi-threading and Parallel Processing in Webapplication - Advise needed

Source Link
John
  • 121
  • 6
  • 18
Loading