eclipse-mosquitto / mosquitto

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

Bridge to another broker (HiveMQ): Can incoming topics from the other broker be retained on the local Mosquitto broker? #3102

Open speckenbuettel opened 2 months ago

speckenbuettel commented 2 months ago

Hi,

I am using a bridge between my local Mosquitto (2.0.18) and a remote broker (HiveMQ Cloud).

Can the local Mosquitto be configured in such a way that incoming topics can be retained on the local Mosquitto, even if there are no updates from the remote broker or the connection is down?

Thanks.

ckrey commented 3 weeks ago

The local mosquitto will retain incoming topic messages if the message was sent with the retained flag to the remote broker. The remote broker will propagate the retained flag.

As a result, a client subscribing to the local broker will receive the retained messages even if the remote broker is not connected.

There is no feature in MQTT/mosquitto to retaine messages for topics which are not retained originally.

Does this answer your question?