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


From: "Roger Light" <roger@xxxxxxxxxx>
To: "General development discussions for the mosquitto project" <mosquitto-dev@xxxxxxxxxxx>
Sent: Monday, 22 March, 2021 18:28:25
Subject: Re: [mosquitto-dev] Topic aliasing on messages sent out by Mosquitto
Hi Vera,

That's an interesting idea - and easily achieved with user-properties.

I've just pushed a version to the develop branch which just limits topic to a maximum count, set to 10 by default.

Options max_topic_alias_broker and bridge_max_topic_alias are the ones to look at if you want to test it out.

Cheers,

Roger

Hi Roger,

Thanks for including this.

I compiled the develop branch (commit 5177dd4d) and had a test between two brokers (whether a bridge negotiates aliases). It was kind of hard to diagnose because neither broker writes debug messages about having negotiated topic aliases, but I used tcpdump to analyze the traffic, and in a chain of mosquitto_pub -> broker1 -> broker2, the topic name disappears after the first publish. The tcpdump was between broker1 and broker2.

However, how is 'max_topic_alias_broker' supposed to work (so for normal subscribers)? When I start a local broker and subscribe with debug:

  ./mosquitto_sub -d -V mqttv5 -d -t '#' -i subber [--property publish topic-alias 10]

I see:

  Client subber received PUBLISH (d0, q0, r0, m0, 'P/fc6947c40ffb/out/bla/long/longlong/long/long', ... (45 bytes))
  [Thu 2021-May-27 15:24:06 CEST first publish]
  Client subber received PUBLISH (d0, q0, r0, m0, 'P/fc6947c40ffb/out/bla/long/longlong/long/long', ... (46 bytes))
  [Thu 2021-May-27 15:24:08 CEST second publish]

Do I misunderstand how 'max_topic_alias_broker' is supposed to work?

And when all this works as expected, is it perhaps known already which version of Mosquitto will include this feature?

Regards,

Wiebe





Back to the top