Getting the CLI sub cmd to display "missed" meesages

Dear HiveMQ-Team,
dear MQTT-comrades,

I’m trying to get the CLI-Tool to display missed messages. I.e. I am doing the following:

mqtt sub -q 2-i 42 -se 1000 --no-cleanStart -t testtopic -h localhost -p 10083
mqtt pub -q 2 -t testtopic -h localhost -p 10083 -m “test”
// then ctrl-c the sub cmd
mqtt pub -q 2 -t testtopic -h localhost -p 10083 -m “test2”
// then start the same sub-cmd again.

What I was expecting is to see the test2-message after restarting the sub-cmd, but the CLI doesn’t display them.

What am I missing? As far as I understood the documentation, QoS 2 and cleanSession=false should imply to receive missed messages.

Did I get the documentation wrong, did I fail to use the CLI correctly or?

Any help appreciated.

Kind regards
Daniel

Hi @daniel.altmann and welcome to the forum! :tada:

I could not reproduce the problem on my side - Everything seems to work fine for me,
so after I subscribe the second time I receive all the missed messages instantaneously.

Is it possible that you missed to set the --no-cleanStart flag on the second subscribe?

So in my eyes you have correctly understood the documentation and have used the CLI correctly.

HiveMQ Container running on port 1883:

Your subscribe command (I just changed the port):

Your publish commands (default port 1883 used, second publish executed while the client is not subscribed):

Best regards
Till

Hello Till,

when I started to dive into HiveMQ / MQTTI was using this tutorial:

following this advice:

$ wget 
https://github.com/hivemq/mqtt-cli/releases/download/v1.0.0/mqtt-cli_1.0.0_all.deb
$ sudo apt install ./mqtt-cli_1.0.0_all.deb

The problem is not present in a newer version of the mqtt client, i.e. it works as you describe with version 4.5.2, it does not with 1.0.0

Thanks for your help.

Kind regards,
Daniel