简体   繁体   中英

IIS-Hosted WebAPI Stops Processing RabbitMQ-Queued Messages

I have a C# WebAPI that is hosted in IIS that listens to a RabbitMQ queue. When the Application Pool is started, it seems the processing of queued messages functions as expected. After a period of time, though, it appears as though the service stops picking up the messages from the queue. I am suspecting that its IIS putting the thread for the app pool to sleep or some such thing but not certain. Is there a way to ensure that the thread and the connection to RabbitMQ is not suspended to confirm? Also, if this is a known issue and my suspicion is incorrect (that its an IIS issue), please let me know.

From a thread entitled " .NET Core 3.1 Web Consumer -IIS (RabbitMQ) ", it turns out I was correct. IIS was suspending the thread for the application pool. Changing the .NET CLR Version to v4.0 instead of No Managed Code, Start Mode to AlwaysRunning , and Idle Time-out (minutes) to 0 resolved my issue. Adding the Application Initialization Windows Feature required a restart of the server.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM