0

I am using a concurrent queue in my Web API as mentioned in thread How to maintain state or queue of requests in Web API

But I am running into an issue where if the application pool is stopped or recycled it looses all the data in the memory. Can someone help me as to how I can handle the same?

My use case requires accepting messages from different origins and putting in the queue and after every 5 seconds interval i am writing those messages to an input .txt file.

  • Store them somewhere external to the web app - like SQS or Rabbit. – mjwills Jul 06 '20 at 07:06
  • But if every 5 seconds i send queued up messages to RabbitMQ and then again retrieve the same and write it to file, will it not impact the performance and will it not be a overhead? – LeoCoder123 Jul 06 '20 at 08:32
  • Of course there will be overhead. Nothing is going to be faster than doing it all in memory. But in memory, by definition, is going to have a risk of data loss. – mjwills Jul 06 '20 at 11:45

0 Answers0