Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [mosquitto-dev] Topic aliasing on messages sent out by Mosquitto

Hi Wiebe,

I'd like to support broker initiated topic aliases. The question for me is how that should be designed and presented to the user to configure.

There are a few ways I see it could work:

* The broker admin has to explicitly configure every topic eligible for aliasing
* The admin configures a wildcard topic filter and matching topics are aliased on a first comeĀ first serve basis
* No config at all - topics aliased on a first come first serve basis
* The broker analyses topic frequency for a while before deciding what to alias
* Each of the above, plus only for topics over a certain length

What have I missed? What do you all think?

Regards,

Roger

On Thu, 18 Mar 2021, 09:33 Wiebe Cazemier, <wiebe@xxxxxxxxxxxx> wrote:
Hi,

(This is a resend of a mail sent on 2 June, 2020 16:40. It never got a reply, but I since then learned the list breaks DMARC and puts messages in spam. Also mailing Roger directly).

I've been able to successfully use topic aliases with Mosquitto 1.6.8, but only when initiating it as a publisher. Apparently, as a subscriber, you can't request that a broker use aliases for messages that are sent out? I suppose that's not part of the standard? Is it doable/desirable to be able to configure Mosquitto to attempt to use aliases when subscribers connect with 'topic-alias-maximum' set?

And what about bridges? We also use Mosquitto as client and it would be very beneficial if we could make all the topics aliased.

Regards,

Wiebe


PS For illustration:

If I publish, I can see the second message's 'null' topic:


# ./mosquitto_pub -V mqttv5 -u wiebe -P "$wiebepass" -h 127.0.0.1 -p 18883 --insecure -t 'R/asdf/adsf/asdf/asdf/' --property publish topic-alias 1 -d -l
Client (null) sending CONNECT
Client auto-6E67EB4C-C338-E189-EA8A-2F199A0F265D received CONNACK (0)
message one
Client auto-6E67EB4C-C338-E189-EA8A-2F199A0F265D sending PUBLISH (d0, q0, r0, m1, 'R/asdf/adsf/asdf/asdf/', ... (11 bytes))
message two
Client auto-6E67EB4C-C338-E189-EA8A-2F199A0F265D sending PUBLISH (d0, q0, r0, m2, '(null)', ... (11 bytes))


When I subscribe, I still see the topic:


# ./mosquitto_sub -V mqttv5 -u wiebe -P "$wiebepass" -h 127.0.0.1 -p 18883 --insecure -t '#' -v -d --property connect topic-alias-maximum 10
Client (null) sending CONNECT
Client auto-18E5C5B9-9124-3D6C-CF1A-94A107AEF380 received CONNACK (0)
Client auto-18E5C5B9-9124-3D6C-CF1A-94A107AEF380 sending SUBSCRIBE (Mid: 1, Topic: #, QoS: 0, Options: 0x00)
Client auto-18E5C5B9-9124-3D6C-CF1A-94A107AEF380 received SUBACK
Subscribed (mid: 1): 0
Client auto-18E5C5B9-9124-3D6C-CF1A-94A107AEF380 received PUBLISH (d0, q0, r0, m0, 'R/asdf/adsf/asdf/asdf/', ... (11 bytes))
R/asdf/adsf/asdf/asdf/ message one
Client auto-18E5C5B9-9124-3D6C-CF1A-94A107AEF380 received PUBLISH (d0, q0, r0, m0, 'R/asdf/adsf/asdf/asdf/', ... (11 bytes))
R/asdf/adsf/asdf/asdf/ message two


Back to the top