eclipse / paho.mqtt.m2mqtt

Eclipse Public License 1.0
512 stars 303 forks source link

Connection get lost after some minutes of inactivity #97

Open LPascual-mk opened 5 years ago

LPascual-mk commented 5 years ago

Hi, I am developing an ASP.NET MVC application using the MQTT library to receive messages from an Active MQ broker and store these messages in a database. To fire the connection and subscription to the broker in background I am using Hangfire at the startup of the application (global.asax)

I have a global object in the 'global.asax' file which contains the connection to the broker. My goal is that the connection and subscription to the queue remains active even when the web application is not opened in a browser, so I need a persistent subscription once I connect to the broker during application deployment.

The issue I am facing is that the connection gets lost after some minutes of inactivity. I have read that the library implements a keep alive mechanism but I don't know why my connection is getting lost. May be an issue with the definition scope of my MQTT client variable?

Thanks in advance!

tanranran commented 4 years ago

+1

yesidbalvin commented 3 years ago

+1