Node JS mqtt client doesn't received subscribed messages when broker goes down and comes up
<p>I have created a mqtt node js client. My connection options are as follows.</p>

<pre><code>mqttOptions = {
clientId: '100',
keepAlive: 1000,
clean: false,
reconnectPeriod: '1000',
will: willMessage
};
</code></pre>

<p>I disconnected the server and brought it up again, while the client was still running. The client had the logic to publish every 1 second. Though the client was publishing after this reconnect, it was not receiving the message. It was subscribed to its own message topic. Since I set the clean option to be false, should it not subscribe to the topics on the reconnect and start receiving them?</p>

<p><a href="https://i.stack.imgur.com/v72FX.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/v72FX.png" alt="enter image description here"></a></p>

<p>Below is how I'm establishing the connection.</p>

<pre><code>this.client = mqtt.connect(url, mqttOptions);
</code></pre>

<p>and below is how I'm subscribing.</p>

<pre><code>this.client.subscribe(topic);
</code></pre>

<p>What am I doing wrong here? Please advice.</p>