mosquitto-users team mailing list archive
-
mosquitto-users team
-
Mailing list archive
-
Message #00403
?????? ?????? I met a strange question
Thanks roger for your patient answer . I did many tests about this question. below is latest test :
1> setup mosquitto-1.2-install-cygwin.exe ,than modify "persistence true"??"persistence_file mosquitto.db"??"persistence_location e:\mosquitto\"??"port 55003" in mosquitto.conf ONLY.
2> use mosquitto_pub command to publish a test message. In the same time , use mosquitto_sub command to
subscribe message . mosquitto_sub start with '-c' param to receive durable subscribe
3> pub a message , then sub command will receive it , everything is ok.
4> restart mosquitto service . then pub some test messages
5> mosquitto_sub receive nothing. restart mosquitto_sub ,then pub messages again , also receive nothing
All in all, If i set cleansession=false in mqtt client , receive some message then restart mosquitto broker. mqtt client will not receive message at all , The only way i known to make mqtt client normal is delete persistent file then restart mosquitto service.
-----------------------------------------------------------------wrote by roger
This doesn't seem to be related to Francois' problem, so I presume you
meant to reply in the "I met a strange question" thread.
I'm afraid it's still very difficult to know exactly what problem you
are having. Please post exactly the steps you go through and exactly
what you expect to happen. Don't miss any steps out and don't omit any
configuration options - you say you have those three options in use,
but then connect to a non-standard port. Either you missed a
configuration option or you are connecting to a different broker than
you think.
If you are saying that you expect the mosquitto_sub client to receive
the test11 message, but that you have deleted the persistence file
before restarting mosquitto, then this is expected behaviour. If you
delete the persistence file then you have deleted the information that
mosquitto would use to know which clients should have messages stored.
In effect, this is the first time that the client "112" has connected
to the broker.
Regards,
Roger
------------------ ???????? ------------------
??????: "Karl Palsson";<karlp@xxxxxxxxxxxx>;
????????: 2013??12??11??(??????) ????10:00
??????: "mosquitto-users"<mosquitto-users@xxxxxxxxxxxxxxxxxxx>;
????: Re: [Mosquitto-users] ?????? I met a strange question
If you could share your paho code, people might know more, it's very hard to understand what you're doing I'm
sorry.
What I _think_ is happening, is that while you are publishing with qos2, you might not have
clean_session=False, or you might not have stable/persistent client ids. In that case, paho might reconnect,
but it won't resubscribe. (If paho even reconnects)
On Wed, Dec 11, 2013 at 10:10:49AM +0800, ??(Grey)?? wrote:
> 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
> .
> --
> 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
--
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