Home:ALL Converter>Handling network problems while inserting in MongoDB

Handling network problems while inserting in MongoDB

Ask Time:2018-06-08T22:10:43         Author:Mhmd

Json Formatter

I am working on a project with large amount of live data by asp.net core 2.0, C# and MongoDB. I have thousands of sensors which send live data to the server. I have a problem with network issues. This is possible that my web-server for a few minutes can not communicate with database Server. I've tried to test it locally, if it is about 20 or 30 seconds, web-server will resume, but if it goes to more than a minute, web-server will lost the connection and after that I need to restart the application. I tried to use connectionTimeOutMS and socketTimeOutMS but those couldn't help me.
How can I prevent that and handle this problem? Is there any solution or backup plan to handle this?

Author:Mhmd,eproduced under the CC 4.0 BY-SA copyright license with a link to the original source and this disclaimer.
Link to original article:https://stackoverflow.com/questions/50762538/handling-network-problems-while-inserting-in-mongodb
yy