eclipse-mosquitto / mosquitto

Eclipse Mosquitto - An open source MQTT broker
https://mosquitto.org
Other
9.05k stars 2.39k forks source link

LWT on child broker #1180

Open agrosjea opened 5 years ago

agrosjea commented 5 years ago

Hi ! I am enountering an issue on Mosquitto using a dual broker configuration main broker in the cloud is 1.5.5 (cant update right now) client broker is 1.5.7 under Windows with the following conf file :

port 1883
protocol mqtt
connection_messages true
log_timestamp true
log_type warning
log_dest file c:\mqtt_log.log

connection MyServer
address myserver:1883
topic # both 1
clientid MyClientBroker

A possible workaround for me would be to be able to define an Will message for the Windows broker itself. But I do not see any mention in the config file on how to define a Will.

vincent-boulin commented 5 years ago

Hello,

I'll let more experienced people confirmed what i say but it seem this is already corrected : #1143. If you look the changelog of the 1.5.6 version this issue is mentionned.

agrosjea commented 5 years ago

Hi ! The issue you referenced was on websocket only. I used TCP/MQTT protocol here. I can update my server to 1.5.7 just to ensure I can reproduce with 1.5.7 both sides...

agrosjea commented 5 years ago

I installed 1.5.8 on my server I confirm: -CASE 1 : whenever im connected to my local broker with my client and disconnect my client in a clean way from the broker. the LWT message is send by the broker -CASE 2 : if I kill my local broker, the LWT message is not handled by the remote broker.

image

I will create another issue to be able to set an LWT message when Mosquitto 1.5.7 connects to 1.5.8 which could do the trick I think...

ckrey commented 2 weeks ago

The bridge protocol (between your "Mosquitto 1.5.7" and "Mosquitto 1.5.8") does not support LWTs other than forwarding the LWTs of the clients.

This means what you see is how it was designed.

If you want to monitor the status of your bridge between the to brokers, please consider to use notification messages in mosquitto.conf:

# Choose the topic on which notification messages for this bridge are
# published. If not set, messages are published on the topic
# $SYS/broker/connection/<clientid>/state
#notification_topic

Can this issue be closed?