• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Ron McLeod
  • Tim Cooke
  • Liutauras Vilda
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Rob Spoor
  • Junilu Lacar
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Piet Souris
  • Carey Brown
Bartenders:

Creating a Thread Pool in a Singleton Bean

 
Ranch Hand
Posts: 69
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Every one,
I have a web application which requests a jasper export of the UI content (Single page app) with the click of an I icon on the web page the requests gets to a REST end point that takes the request and calls a spring processor class with a request object. The Processor class is a spring singleton scoped bean which calls an extended class’s report fill method which actually makes the db call to fill the jasper report after which the response is routed and the browser gets back the exported file. As the number of requests goes up I was thinking of implementing some sort of thread pool to hold incoming requests from the web in this processor and allow only limited set of threads to execute at any time as the number of records for each export can be quite big, after looking around I hit up on org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor. I am injecting taskexecutor into the processor class. My question is how do I get access to incoming thread requests and how to use taskexecutor. I am assuming will pull in coming threads and putting them in taskExecutor will make restrictions to start to kick in using settings. I am right? Please correct me if I am wrong Thanks in advance.



reply
    Bookmark Topic Watch Topic
  • New Topic