Job Queue within Website?
-
Hello, I have a need to create a spreadsheet upon demand (use triggered). Because of the volume of records, I cannot have the user wait and was thinking of creating a job queue. My question is if I create the queue within the website (separate running thread) and the last user logged off, does IIS shutdown the website even though a spreadsheet could be in the middle of being created or is it smart enough to realize a thread is "busy" doing something so stay running? If not, is the recommendation to create a windows service that would had the creation of these spreadsheets or? Thanks for your time, Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
-
Hello, I have a need to create a spreadsheet upon demand (use triggered). Because of the volume of records, I cannot have the user wait and was thinking of creating a job queue. My question is if I create the queue within the website (separate running thread) and the last user logged off, does IIS shutdown the website even though a spreadsheet could be in the middle of being created or is it smart enough to realize a thread is "busy" doing something so stay running? If not, is the recommendation to create a windows service that would had the creation of these spreadsheets or? Thanks for your time, Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
Hi, I would suggest to use middleware instead of relying on separate thread. Some of the suggested option in your case: 1. Message Queue: MSMQ, MS Service Bus or RabbitMQ OR 2. Add your Queue in persistent storage/Cache like Redis. It is reliable and will mostly process your queue even when your server restart. Hope this will help.
Life is a computer program and everyone is the programmer of his own life.
-
Hello, I have a need to create a spreadsheet upon demand (use triggered). Because of the volume of records, I cannot have the user wait and was thinking of creating a job queue. My question is if I create the queue within the website (separate running thread) and the last user logged off, does IIS shutdown the website even though a spreadsheet could be in the middle of being created or is it smart enough to realize a thread is "busy" doing something so stay running? If not, is the recommendation to create a windows service that would had the creation of these spreadsheets or? Thanks for your time, Nathan
'Never argue with an idiot; they'll drag you down to their level and beat you with experience.' ~ anonymous
Scott Hanselman posted a good list of the various options for scheduling background jobs in ASP.NET a while back: How to run Background Tasks in ASP.NET - Scott Hanselman[^]
"These people looked deep within my soul and assigned me a number based on the order in which I joined." - Homer