mosquitto icon indicating copy to clipboard operation
mosquitto copied to clipboard

Dynamic Topic Bridging

Open david-katz opened this issue 9 years ago • 2 comments

Problem: mosquitto is being used as a bridge for multiple local clients that are subscribing to topics on a remote MQTT broker.

There is a large number (1000s) of topics under the same root (a/1, a/2, a/2/x etc.) The local clients are only interested in a small subset (ca. 5) of all a/# topics, but will decide at runtime which of these topics are relevant to them.

The communications link between the bridge and the remote broker is expensive, so that messages on non-relevant topics must not be transmitted.

In order to solve this problem, I would like to discuss the possibility of introducing the following functionality to the mosquitto bridge:

  • allow the bridge to be configured to bridge certain topic ranges (for instance a/#) without causing a subscription to happen on this range at bridge startup time.
  • only if a subscription request is submitted by one of the bridge's local clients will a subscription be sent to the remote broker.
  • when the local client unsubscribes, the subscription on the remote broker is also unsubscribed.

david-katz avatar Oct 17 '16 10:10 david-katz

Sorry for the delay in responding, I'm completely swamped at work at the moment and that has an impact on the free time I have for mosquitto.

I think this sounds like an interesting idea and initially positive about it - but haven't had chance to think about the implications yet.

ralight avatar Oct 26 '16 09:10 ralight

  • only if a subscription request is submitted by one of the bridge's local clients will a subscription be sent to the remote broker.
  • when the local client unsubscribes, the subscription on the remote broker is also unsubscribed.

I find these points really interesting, since the Issue is several years old, is it possible to do this with the latest versions of Mosquitto or is something similar planned?

aeri avatar Dec 07 '22 19:12 aeri