Weird MQTT Behavior

I am hoping someone can help me understand what’s going on with MQTT.

It seems to “ignore” or “skip” every 4th message, no matter what device I push it from to the broker, and regardless of topic. I subscribe to listen to # and this is what happens.

I push homeasstant/test, MQTT reports “Message 1 received”
I push homeasstant/test 2nd time, MQTT reports “Message 2 received”
I push homeasstant/test 3rd time, MQTT reports “Message 3 received”
I push homeasstant/test 4th time, MQTT doesn’t report anything as if nothing received
I push homeasstant/test 5th time, MQTT reports “Message 4 received”

And this pattern keeps repeating in a loop. Every 4th message, is “lost” somehow. Then MQTT receives the next 3, but then the 4th one will be lost again and it keeps going like that.

Wondering if anyone has ever run into a problem like this before?

I can’t begin to figure out what is going here, it’s not something I have encountered before. However in order for people to help you, the first thing they are going to ask is - what is the MQTT server? How is it installed?

Eg - Are you using the MQTT server addon from the addon store, or is this a standalone MQTT server (like Mosquitto) installed separately to Home Assistant?

Yeah straight from the addon store, I haven’t done any customizations or anything like that yet. Just trying out some basic things when I noticed some of my pushes were being ignored, and thats when I discovered this pattern.

If you feel comfortable, can you install http://mqtt-explorer.com/ on whatever machine you are using (not the Home Assistant machine), and connect it to the MQTT broker and see if it shows the same behaviour?

Yep seeing the same pattern there too. I also just noticed that after restarting the broker, now the pattern has changed, and its now every other message that gets ignored, then the next one goes through just fine. So instead of every 4th, now its every 2nd.

So strange…

Is it the one listed under Official Addons or the one from the Community Addons?

The Official one hasn’t been updated in 5 months, and no-one else appears to be having problems with it.

If it is the official one, maybe try uninstalling it and then re-installing it, in case something has got corrupted somewhere.

EDIT:
What does the Addon page show for RAM and CPU use for the broker?

Are you pushing the same or different messages?

Regardless of whether I push same or different messages, this behavior occurs. I am running the official addon and I did try reinstalling but seems to be the same thing.

I have noticed that changing some of the MQTT configuration settings will change the pattern of “lost” messages. So like turning off birth message for example now causes every 3rd message to get lost. Turning off will message causes every other one to skip. Weird stuff.