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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tedge services to support custom mqtt topic scheme #2727

Open
albinsuresh opened this issue Feb 16, 2024 · 0 comments
Open

Tedge services to support custom mqtt topic scheme #2727

albinsuresh opened this issue Feb 16, 2024 · 0 comments
Labels
improvement User value

Comments

@albinsuresh
Copy link
Contributor

albinsuresh commented Feb 16, 2024

Is your feature improvement request related to a problem? Please describe.

Even though tedge config allows you to change the device topic id using the mqtt.device_topic_id config setting, the value is expected to follow the default topic scheme itself in the device/<entity-id> format.

When a custom topic scheme is used as follows:

tedge config set mqtt.device_topic_id custom/device//

the mapper refuses to start with the following error message:

Feb 16 08:40:37 9be5165914a8 tedge-mapper[5172]: Error: Can't derive service name if device topic id not in default scheme
Feb 16 10:35:54 9be5165914a8 systemd[1]: tedge-mapper.service: Main process exited, code=exited, status=1/FAILURE

... and the agent also fails with a similar message:

Feb 16 10:35:54 9be5165914a8 tedge-agent[5354]: Error: Device topic id custom/device// currently needs default scheme, e.g: 'device/DEVICE_NAME//'
Feb 16 10:35:54 9be5165914a8 systemd[1]: tedge-agent.service: Main process exited, code=exited, status=1/FAILURE

Describe the solution you'd like

Allow custom topic schemes to be used in the device topic id and make sure that all services like tedge-agent, mappers and even the mqtt bridge honours that topic id.
 
Additional context

Updating the topic id after using the default topic scheme for a while would not be trivial as all the retained metadata messages published to the older topic id will have to be removed/reconciled. So, the scope of this ticket can be limited to just setting a different topic scheme before any bootstrapping. Updating an already used topic scheme can be addressed in a different ticket.

@albinsuresh albinsuresh added the improvement User value label Feb 16, 2024
@albinsuresh albinsuresh changed the title Support custom mqtt topic scheme for main device Tedge services to support custom mqtt topic scheme Feb 16, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
improvement User value
Projects
None yet
Development

No branches or pull requests

1 participant