How to configure "Server-References" of MQTT 5.0?

17 views
Skip to first unread message

Suzuki Takanori

unread,
Nov 20, 2021, 8:52:25 AM11/20/21
to vernemq-users

Hi,

I am trying to use the "Server-References" of MQTT 5.0 Control Packet.

VerneMQ is fully supported MQTT 5.0,
but I can't find the "Server-References" configuration in the any documents.

Does anyone know how to configure "Server-References?

Regards,


André Fatton

unread,
Nov 20, 2021, 10:52:46 AM11/20/21
to vernemq-users
Hi,

Interesting question. Apart from the question whether this is optional or mandatory in the spec, there's another point: would this be an internal (broker implementor's) decision, or an external decision (by broker's administrator).

I can see it could be an administrative configuration for the following example. Let's take the server_moved response code in a CONNACK (where you can give a server reference). You would use this for the case where you want a historical MQTT server to stay up online, and tell all the connecting clients to permanently use another MQTT server.
You probably only want to give this information to authenticated MQTT clients, so you'd have to have full authentication on the historical server. As this is done by a plugin, the natural setting point for the CONNACK response code is probably a modifier in an "auth_on_register" hook.

I haven't looked at it and it might be implicitly possible to do this already.

Is my given example your use case, or are you trying to achieve something else?

Cheers,
André

Suzuki Takanori

unread,
Nov 20, 2021, 9:48:46 PM11/20/21
to vernemq-users
Hi, André.
Thank you for your reply.

My point of view is the broker's administration,
and I think the use case you have wrote is what I want to do.

But, is it not used "Server Reference" header(0x1C)?

Are the following steps correct for what you are describing?

  - The client connect to the broker.
  - The broker return the response code as "server_moved".
      - Use "auth_on_register" at the CONNACK flow.
  - The client disconnect to the borker and connect new broker.

Regards,

2021年11月21日日曜日 0:52:46 UTC+9 a...@erl.io:
Reply all
Reply to author
Forward
0 new messages