title: after reconnection subscriber does not getting messages
body: <p>N.B. I am using <code>EMQX</code> as broker and <code>python-paho</code> as the client library. I am not sure which one is responsible for this problem.</p>
  <p>If the publisher does not send any message for some time, the subscriber gets disconnected but also gets re-connected again (since loop_forever automatically handles reconnection). But after reconnection, if the producer starts to send data again, the auto-reconnected server does not get any messages. In that case, the subscriber needs to start again (manually reconnection)</p>
  <p>My Subscriber</p>
  <pre><code>import paho.mqtt.client as mqttClient
  import json
  import datetime
  
  def on_connect(client, userdata, flags, rc):
  
      if rc == 0:
          print(&quot;Connected to broker&quot;)
  
      else:
          print(&quot;Connection failed&quot;)
  
  def on_disconnect(client, userdata, rc):
      if rc != 0:
          print(&quot;Unexpected MQTT disconnection. Will auto-reconnect&quot;)
      
  
  def on_message(client, userdata, message):
      print(str(datetime.datetime.now())+str(message.payload) + &quot;\n&quot;)
  
  
  #broker_address= &quot;3.121.233.176&quot; 
  broker_address= &quot;address_of_the_broker&quot; 
  port = 1883                     
  client = mqttClient.Client(&quot;clientLB1&quot;)               #create new instance
  client.on_connect= on_connect                      #attach function to callback
  client.on_message= on_message                      #attach function to callback
  client.on_disconnect = on_disconnect
  client.connect(broker_address,port,60)
  client.subscribe(&quot;xdk1&quot;) #subscribe
  client.loop_forever() #then keep listening forever
   
  </code></pre>
  <p>My Publisher:</p>
  <pre><code>import paho.mqtt.client as paho
  import time
  from random import random
  
  def on_publish(client, userdata, mid):
      print(&quot;mid: &quot;+str(mid))
   
  client = paho.Client()
  client.on_publish = on_publish
  #client.connect(&quot;35.157.39.224&quot;, 1883)
  client.connect(&quot;LBmqtt-1826452731.eu-central-1.elb.amazonaws.com&quot;, 1883)
  client.loop_start()
  
  while True:
      temperature = random()
      (rc, mid) = client.publish(&quot;xdk1&quot;, str(temperature), qos=1)
      time.sleep(.1)
  
  </code></pre>
  <p>How to solve this problem?</p>