Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] How to avoid mosquitto bridge from automatically subscribing to all topics, i.e., "#"?

Thanks for the reply.  My apologies if my question was  unclear, but Ben Hardill provided the solution to me off-list.  It was actually quite easy and I simply overlooked it because I had been focus on the local-prefix and remote-prefix rather than the pattern.  Here was Ben's response for the benefit of others:

> You can control what topics pass over the bridge with the `topic` config option
> in the bridge setup.
> 
> > topic pattern [[[ out | in | both ] qos-level] local-prefix
> > remote-prefix]
> 
> The example subscribes to '#' (second option)
> 
> topic # both 2 local/topic/ remote/topic/
> 
> But it doesn't have to be '#' you can set it to anything you want.
> 
> See the bridge section in the man page for details.
> https://mosquitto.org/man/mosquitto-conf-5.html#idm45942561391264
> 
> You can't dynamically only request topics over the bridge as local clients
> subscribe, the protocol doesn't work that way.

So I only needed to change:
    topic # both 2 local/topic/ remote/topic/
to:
    topic foo/# both 2 local/topic/ remote/topic/

- Chris

> -----Original Message-----
> From: mosquitto-dev-bounces@xxxxxxxxxxx [mailto:mosquitto-dev-
> bounces@xxxxxxxxxxx] On Behalf Of Tatsuzo Osawa
> Sent: Thursday, November 9, 2017 6:50 AM
> To: General development discussions for the mosquitto project <mosquitto-
> dev@xxxxxxxxxxx>
> Subject: Re: [mosquitto-dev] How to avoid mosquitto bridge from automatically
> subscribing to all topics, i.e., "#"?
> 
> I think your wish is impossible because the bridge cannot know subscribers of
> the remote broker dynamically. You can set static filters on the bridge by using
> topic directive.











CONFIDENTIALITY NOTICE: This message is the property of International Game Technology PLC and/or its subsidiaries and may contain proprietary, confidential or trade secret information.  This message is intended solely for the use of the addressee.  If you are not the intended recipient and have received this message in error, please delete this message from your system. Any unauthorized reading, distribution, copying, or other use of this message or its attachments is strictly prohibited.



Back to the top