Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Using singleton TaskExecutor and CompletionService

 
Zhui Shen Ge
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic