Sim800a mqtt connection with hivemq is getting disconnected

mqtt connection with hivemq server is getting disconnected after 10-15 seconds of connection

I suggest you use the TinyGSM library. You should also have a unique topic that is just your topic.