← Back to team overview

mosquitto-users team mailing list archive

Re: ?????? I met a strange question

 

thanks . even though i pub a new message , my paho client also can't sub any messages , so i think this problem has nothing with retained flag.
  

 

 ------------------ Original ------------------
  From:  "Jan-Piet Mens";<jpmens@xxxxxxxxx>;
 Date:  Tue, Dec 10, 2013 07:40 PM
 To:  "mosquitto-users"<mosquitto-users@xxxxxxxxxxxxxxxxxxx>; 
 
 Subject:  Re: [Mosquitto-users] ?????? I met a strange question

 

Hello,

>         1.delete mosquitto.db then restart mosquitto 
>         2. pub a qos 2 message without sub 
>         3. restart subscriber and cannot receive message any more.

If you intend to be able to get messages previously published to the
broker (i.e. retained *by* the broker), you have to set the `retain'
flag on messages as you publish them. With the command-line tools, you'd
do something like this:

        mosquitto_pub -t topic -m payload -r

A subsequent SUB on that topic (provided ACLs allow you to do so) will
read that last retained message for that particular topic.

        -JP

-- 
Mailing list: https://launchpad.net/~mosquitto-users
Post to     : mosquitto-users@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~mosquitto-users
More help   : https://help.launchpad.net/ListHelp
.

Follow ups

References