Using singleton TaskExecutor and CompletionService
Zhui Shen Ge
posted 7 years ago
Requirement: JMS listener to spawn multiple concurrent web service requests. Each listener thread (the main thread) will wait max of 30 seconds. A maximum number of 5 child threads might be spawned from the main thread.
Is it safe to use a singleton TaskExecutor (I intend to use Spring's ThreadPoolTaskExecutor), and creating new instances of ExecutorCompletionService in the main thread?