PROBLEM -
I have created an MQTT Source Connector using Lenses. The connector works fine till the data is being published on my MQTT Mosquitto broker and works seemlessly. Now, when i stop publishing the data and there is no data sent to the mqtt source connector, after about 4-5 mins , if i start publishing the data again , the data doesn't come in my source connector even though the connector is still in running state. For resolving this i need to restart my connector everytime which is bad.
METHODS I HAVE ALREADY TRIED -
Even though the client id is unique, i still changed it everytime to see if that was the issue. But it didn't work.
Tried increasing the keepalive interval to 10 mins but that didn't work too.
There were no error logs in kafka connect logs for this for a long time, but once in 15-20 tries i received this Socket Connection Error
UPDATE
Upon digging more into the issue, I found out that my source connector (behaving as an mqtt client) was not sending any PINGREQ packets to my Mosquitto MQTT broker when it was idle in its keep-alive time interval while other client conencted to my mqtt broker were sending their PINGREQ packets when they were idle and hence the connection between the source connector and the mqtt broker was getting dropped.
Do I need to specify any property explicitly in my MQTT Source Connector properties file to send a PINGREQ packet to the MQTT broker in the keep-alive time or does the connector handles that itself ?