Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[paho-dev] ?????? ?????? ?????? ?????? How to receive a "last will" message

Thank you piper.  I will do more test and if needed add a bug in ActiveMq.


------------------ ???????? ------------------
??????: "Andy Piper"<andypiperuk@xxxxxxxxx>;
????????: 2013??8??26??(??????) ????5:58
??????: "General development discussions for paho project"<paho-dev@xxxxxxxxxxx>;
????: Re: [paho-dev] ?????? ?????? ?????? How to receive a "last will" message

If this is an issue you can reproduce against ActiveMQ (you don't mention which version) using the Paho and mosquitto clients, I would suggest you raise a bug against the broker. Thanks!


On Sat, Aug 24, 2013 at 12:19 PM, ??(Grey)?? <86267306@xxxxxx> wrote:
thanks Roger . I did what you said , now I run paho+mosquitto, and received last will message.
 
so maybe is my activeMQ config file is not correct , missing something? I will figure it out later.
 
I want to say ,today paho-dev's friends helps me much. thank you all :D

------------------ ???????? ------------------
??????: "Roger Light"<roger@xxxxxxxxxx>;
????????: 2013??8??24??(??????) ????7:02
??????: "General development discussions for paho project"<paho-dev@xxxxxxxxxxx>;
????: Re: [paho-dev]?????? ?????? How to receive a "last will" message

To figure out where the problem is, do these set of tests:

Client        |     Broker       | Test passed?
-----------------------------------------------------------
mosquitto  |     mosquitto  |
mosquitto  |     activemq   |
paho         |     mosquitto  |
paho         |     activemq   |

If the tests work with regardless of the broker when using the
mosquitto clients but not with paho, then there is a problem with paho
(or your use of it). If the tests pass regardless of the client being
used with mosquitto as the broker, but not with activemq, then the
problem is with activemq. If you end up with another combination then
there is a compatibility issue somewhere.

Cheers,

Roger

On Sat, Aug 24, 2013 at 11:30 AM, ??(Grey)?? <86267306@xxxxxx> wrote:
> thanks everybody.
>
>  AS Roger Light just saying , I use mosquito as broker and recevied LWT
> Message. It works!! :D
>
> I am now using paho java client and ActiveMQ Broker(default config). Is
> there something wrong ? under paho+activemq I cannot
>
> receive LWT message.
>
>
>
>
>
>
> ------------------ ???????? ------------------
> ??????: "Darren Clark"<dclark@xxxxxxxxxxxxx>;
> ????????: 2013??8??24??(??????) ????6:20
> ??????: "General development discussions for paho
> project"<paho-dev@xxxxxxxxxxx>;
> ????: Re: [paho-dev]?????? How to receive a "last will" message
>
> Publisher or subscriber? The last will is sent as part of the connect
> message. Saying "now that I'm connected, should you find an unexpected
> disconnect publish this message to this topic."
>
> What broker are you using? Once I figured out the semantics of not sending
> on a polite disconnect I found Mosquitto to be very reliable.
>
> -D
>
> On Aug 24, 2013 3:07 AM, "??(Grey)??" <86267306@xxxxxx> wrote:
>>
>> Thxs Darren  , How to make "last will" trigger , I have tried a lot :
>> disuse the network of subscriber , make a exception , run System.exit(1) or
>> just terminate the subscriber .
>>
>>
>> ------------------ ???????? ------------------
>> ??????: "Darren Clark"<dclark@xxxxxxxxxxxxx>;
>> ????????: 2013??8??24??(??????) ????5:48
>> ??????: "General development discussions for paho
>> project"<paho-dev@xxxxxxxxxxx>;
>> ????: Re: [paho-dev] How to receive a "last will" message
>>
>> Not sure if it's the same, probably depends on the client and where the
>> exception happens, but  I was a bit confused at first about LWT. It is a
>> message posted by the broker when it sees the client disconnect
>> unexpectedly, not just any disconnect.
>>
>> So if the exception handling on the client causes it to send a disconnect
>> message to the broker then the LWT won't be sent. It will only be sent if
>> the socket is dropped or some other scenario without a valid disconnect
>> being sent.
>>
>> -D
>>
>> On Aug 24, 2013 2:14 AM, "??(Grey)??" <86267306@xxxxxx> wrote:
>>>
>>> Hi,all:
>>>
>>>          I am confused how to receive a LWT messsge. I have set a last
>>> will in a subscriber A , the last will topic is called "lastwill". and start
>>> subscriber B to listen the "lastwill" topic .
>>>
>>>          When I make some exception in Subscriber A ,to make the
>>> Subscriber disconnect from broker , no message arrived in subscriber B. I
>>> noticed some document said Server will
>>>
>>>          publish the last will message. I spent lots of time and found no
>>> answer , any help will be appreciated , thanks.
>>>
>>>    mqttClient = new MqttClient("tcp://192.168.100.80:1883",
>>> MqttClient.generateClientId());
>>>
>>>
>>>    MqttConnectOptions connectOptions = new  MqttConnectOptions();
>>>
>>>    //set will
>>>    connectOptions.setWill(mqttClient.getTopic("lastwill"), new String("I
>>> am offline").getBytes(), 1, false);
>>>    mqttClient.connect(connectOptions);
>>>    mqttClient.setCallback(new MqttCallback(){...}
>>>
>>>
>>>
>>>
>>>
>>>
>>>
>>> _______________________________________________
>>> paho-dev mailing list
>>> paho-dev@xxxxxxxxxxx
>>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>>
>>
>> _______________________________________________
>> paho-dev mailing list
>> paho-dev@xxxxxxxxxxx
>> https://dev.eclipse.org/mailman/listinfo/paho-dev
>>
>
> _______________________________________________
> paho-dev mailing list
> paho-dev@xxxxxxxxxxx
> https://dev.eclipse.org/mailman/listinfo/paho-dev
>
_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev




--
Andy Piper | Kingston upon Thames, London (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper

Back to the top