Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Public access to internal topic alias mapping for proxying across connections #568

Open
codepitbull opened this issue Mar 25, 2023 · 3 comments

Comments

@codepitbull
Copy link

馃殌 Feature Request

Going through the API I can't find a way to specify or receive an MQTT 5 topic alias.
This is weird since the connection parameters for controlling them are there.

馃攬 Motivation

There should be a way to provide a topic alias for a PUBLISH-message.
There should be a way to read the topic alias returned from the broker in PUBACK.

@pglombardo
Copy link
Contributor

pglombardo commented Mar 27, 2023

Hi @codepitbull - if I'm not mistaken, topic alias are enabled and utilised by default without user intervention. It's a smart move for performance.

This should be documented to be made evident.

@codepitbull
Copy link
Author

codepitbull commented Mar 28, 2023

Yes, but in my request I talk specifically aout specifying those directly.
I am currently analysing cases in which I need to recreate topic-mappings on a different socket.
None of the information around mappings is available on the objects and I need to know and control the Topic Mappings created.

An example for how Paho is doing it:

The MqttProperties are available on every PUBLISH/PUBACK:

https://github.com/eclipse/paho.mqtt.java/blob/f4e0db802a4433645ef011e711646a09ec9fae89/org.eclipse.paho.mqttv5.client/src/main/java/org/eclipse/paho/mqttv5/common/packet/MqttProperties.java#L826

@pglombardo pglombardo changed the title Add support for topic-aliases Public access to internal topic alias mapping for proxying across connections Mar 28, 2023
@SgtSilvio
Copy link
Member

@codepitbull not exposing the topic aliases was an intentional decision. Topic aliases are only valid in the scope of a single connection. Before I go into too much details, I would like to understand what you are trying to achieve.

I am currently analysing cases in which I need to recreate topic-mappings on a different socket.

What do you mean by "recreating topic-mappings"? Proxy an MQTT connection? Then you have 2 connections that each should negotiate its own topic aliases. If the proxy alters or discards any messages, then reusing topic aliases would not be safe. If you want to proxy 1:1, then proxy the binary traffic.
Before we can label this as a feature request, we need to understand what you want to achieve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants