← Back to team overview

mosquitto-users team mailing list archive

?????? ?????? I met a strange question

 

hi,all:
  
      Today i did some test  and found out where errors fire.  when i restart mosquitto broker , my paho client will subscribe nothing. because i have config option: 
      persistence true
      persistence_file mosquitto.db
      persistence_location e:/mosquitto/
  
     If i annotate above options , everything is ok.    File persistence is what i needed , please give me suggestion .
  

 

 ------------------ ???????? ------------------
  ??????: "86267306";<86267306@xxxxxx>;
 ????????: 2013??12??11??(??????) ????10:10
 ??????: "mosquitto-users"<mosquitto-users@xxxxxxxxxxxxxxxxxxx>; 
 
 ????: Re: [Mosquitto-users] ?????? 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
.

References