← Back to team overview

mosquitto-users team mailing list archive

Re: 回复: 回复: 回复: I met a strange question

 

Hi,

The attached is what I get (it works). Are you sure there are no more
details you have missed out?

Cheers,

Roger


On Fri, Dec 13, 2013 at 2:56 AM, 灰(Grey)狼 <86267306@xxxxxx> wrote:
> Sorry , attachment is my config file , I open two window , Window I pub
> ,Window II sub messages.
> in Window I , I published M1、M2 ,and Window II receive it . then restart
> mosquitto. Window II receive nothing at all.
>
> Window I:
> E:\mosquitto>mosquitto_pub -t dsms/110/test -h 192.168.100.79 -q 2 -m M1
>
> E:\mosquitto>mosquitto_pub -t dsms/110/test -h 192.168.100.79 -q 2 -m M2
>
> E:\mosquitto>mosquitto_pub -t dsms/110/test -h 192.168.100.79 -q 2 -m M3
>
> E:\mosquitto>mosquitto_pub -t dsms/110/test -h 192.168.100.79 -q 2 -m M3
>
> E:\mosquitto>mosquitto_pub -t dsms/110/test -h 192.168.100.79 -q 2 -m M3
>
> Window II:
> E:\mosquitto>mosquitto_sub -t dsms/# -q 2 -c -i testclient
> M1
> M2
>
>
>
>
>
>
>
>
>
>
>
>
> ------------------ 原始邮件 ------------------
> 发件人: "Karl P";<karlp@xxxxxxxxxxxx>;
> 发送时间: 2013年12月13日(星期五) 上午10:34
> 收件人: "mosquitto-users"<mosquitto-users@xxxxxxxxxxxxxxxxxxx>;
> 主题: Re: [Mosquitto-users]回复: 回复: I met a strange question
>
>
> If possible can you provide:
>
> a) the config file for the broker
> b) complete commands, _in order_.  If you have two windows open, one for the
> pubsliher and one for the subscriber, and one of restarting the broker,
> please
> include _all_ commands, _in order_
>
> It's extremely difficult to understand what you're doing with the
> descriptions
> you're using.
>
> Sincerely,
> Karl Palsson
>
>
> On 12/13/2013 02:03 AM, 灰(Grey)狼 wrote:
>> 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
>>
>>
>
> --
> 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
>

Attachment: grey.png
Description: PNG image


Follow ups

References