← Back to team overview

mosquitto-users team mailing list archive

Re: Bridging

 

Hi Erik,

Thanks for the reply - I'm running the latest from the mosquitto-dev PPA
which does work fine for bridging with my configuration. We're doing
slightly different things - I want to automatically add <SITE-ID> to all
posts to and from my site brokers. This works fine if I hard-code the
<SITE-ID> into the site broker's mosquitto.conf file, however I'd like to
be able to use the CN from an SSL certificate (i.e. mosquitto username) as
the <SITE-ID>.

I've had a quick look through the source, and it doesn't look like this is
current functionality.

Is it worth me trying to get a patch together to add the functionality, or
is it too far from the MQTT spirit to ever be included in mosquitto?

Thanks,
- Andy




On Thu, Nov 28, 2013 at 5:46 PM, Erik Petersen
<erik.w.petersen86@xxxxxxxxx>wrote:

> Hey Andy,
>
>   What version of mosquitto are you running unless you are compiling from
> the latest trunk I do not think it is possible and even if you are maybe
> not. I posted a very similar question to the mailing list a while back,
> here is that correspondence:
>
> *My question:*
>
> I am trying to configure two mosquitto brokers to use bridges in the
> following way:
> I want a 'master' broker and several 'site' brokers.
>
> I want the site brokers to be configured as follows: The site broker will
> suscribe to the topic <SITE-ID>/# on the master broker and map all incoming
> messages to the local topic #. So a message published to <SITE-ID>/test on
> the master will be published to the topic "test" on the site broker.
>
> For outgoing messages I want anything published to a topic on the site
> broker to be published to the same topic on the master broker
>
> Bridge config that doesnt work"
> connection test
> address <IP-ADDRESS-OF-MASTER>
> cleansession true
> topic # out 0
> topic # in 0 "" <SITE-ID>/
>
> Note that the almost identical configuration on RSMB works:
>
> connection test
> address <IP-ADDRESS-OF-MASTER>
> cleansession true
> topic # out
> topic # in  "" <SITE-ID>/
>
>
> *Response:*
> Hi Erik,
>
> After our conversation on irc last night I ended up coming up with
> part of the solution in a doze this morning:
>
> https://bitbucket.org/oojah/mosquitto/commits/987fd56b34b876333da2de793523adbe83810fe2
>
> It doesn't fix the whole problem generally, but should work for your case.
>
> Cheers,
>
> Roger
>
>
> On Thu, Nov 28, 2013 at 9:06 AM, andy murdoch <andy@xxxxxxxxxxxxxxx>wrote:
>
>> Hi all,
>>
>> I have set up a bridge from msoquitto on a remote device to mosquitto on
>> a central server - it was awesomely easy!
>>
>> Now I would like to know if it is possible to add the remote username in
>> the bridge's topic mapping, like I can in an ACL.
>>
>> I have this in my remote device's mosquitto.conf:
>>
>> connection testbridge
>> address 192.168.1.10
>> topic /test/# in 2 /server""
>> topic /test/# out 2 "" /remote/%u
>>
>> But publishing to /test/hello results in /remote/%u/test/hello across the
>> bridge - the %u is not replaced.
>>
>> Does anyone have an ideas as to how I can accomplish this? Is it even
>> possible? Is it a dumb idea?
>>
>> Thanks in advance.
>>
>> - Andy
>>
>> --
>> Mailing list: https://launchpad.net/~mosquitto-users
>> Post to     : mosquitto-users@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~mosquitto-users
>> More help   : https://help.launchpad.net/ListHelp
>>
>>
>

References