-
Notifications
You must be signed in to change notification settings - Fork 55
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
Enable easier configuration of tedge components to connect to an external mqtt broker #1773
Comments
Perfect.
To say the same things in a different manner: The former settings |
Working on it. Btw is assigning people to issues limited to people with write access to the repo? Because I'd like to like to assign myself when starting them so it actually shows up on the board during dailies. |
As described in thin-edge#1773, config settings for addresses and port numbers were made separate for MQTT clients and brokers, as often connect and bind addresses are different. This change will help in scenarios where the MQTT broker is located outside of the local network, e.g. when using containers or when using a hostname. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
Even after adding the new host/port settings for the clients, we might still need to do some normalization of the config keys to avoid confusions. The ones that I'd still label "confusing" are The other confusion would be coming from the external client's perspective: What host and port should it use to connect to the broker? The |
Yes there will be some cleanup required to sort out the binding settings. However the The mqtt binding settings are really only required to setup the mqtt broker, so the |
As described in thin-edge#1773, config settings for addresses and port numbers were made separate for MQTT clients and brokers, as often connect and bind addresses are different. This change will help in scenarios where the MQTT broker is located outside of the local network, e.g. when using containers or when using a hostname. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
As described in thin-edge#1773, config settings for addresses and port numbers were made separate for MQTT clients and brokers, as often connect and bind addresses are different. This change will help in scenarios where the MQTT broker is located outside of the local network, e.g. when using containers or when using a hostname. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
* Added impl TryFrom<&str> for IpAddress Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> * Add MQTT client address and port config options As described in #1773, config settings for addresses and port numbers were made separate for MQTT clients and brokers, as often connect and bind addresses are different. This change will help in scenarios where the MQTT broker is located outside of the local network, e.g. when using containers or when using a hostname. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> * Make c8y plugins use client address/port settings c8y_configuration_plugin, c8y_firmware_plugin, and c8y_log_plugin didnt's use any MQTT address/host config settings, but were hardcoded to default to localhost. Now they use MqttClientAddressSetting and MqttClientPortSetting settings. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> --------- Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
We need to investigate how best to write a test to cover this as it requires configuring an external mqtt broker. |
…edge#1789) * Added impl TryFrom<&str> for IpAddress Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> * Add MQTT client address and port config options As described in thin-edge#1773, config settings for addresses and port numbers were made separate for MQTT clients and brokers, as often connect and bind addresses are different. This change will help in scenarios where the MQTT broker is located outside of the local network, e.g. when using containers or when using a hostname. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> * Make c8y plugins use client address/port settings c8y_configuration_plugin, c8y_firmware_plugin, and c8y_log_plugin didnt's use any MQTT address/host config settings, but were hardcoded to default to localhost. Now they use MqttClientAddressSetting and MqttClientPortSetting settings. Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com> --------- Signed-off-by: Marcel Guzik <marcel.guzik@inetum.com>
Integration test coverage by #1848 |
Fix typo in mqtt.client.auth.key set error message
Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com>
chore: add maintainer scripts from existing debian packages for later comparison
tedgeUrl is now using the device name instead of "main" for the main device. This change is made on the PR #2108. Signed-off-by: Rina Fujino <18257209+rina23q@users.noreply.github.com> Co-authored-by: Didier Wenzek <didier.wenzek@free.fr>
Is your feature improvement request related to a problem? Please describe.
Configuring thin-edge.io to connect to an external MQTT broker is very difficult as the mqtt/http internal and external bind settings are currently used both for configuring the local MQTT broker and for clients connecting to the broker.
This is a common scenario when running thin-edge.io in a container environment where each thin-edge.io component is running in a separate container. For each container to connect to the MQTT broker, you need to set the same settings as you would when you are setting the mqtt broker binding settings (which is really unexpected for users).
The current settings are very confusing for the users to understand as their semantic meanings are mixed (depending on the component reading the setting).
Currently the following mqtt settings are available, and from the list it is show below:
Describe the solution you'd like
Separate the mqtt client settings from the mqtt bridge/broker settings.
For example, the
c8y-log-plugin
service will start an mqtt client to connect to a broker where it listens to log file requests. This setting should be independent to any mosquitto broker bridge configuration)Add support for setting the mqtt client settings which are used by each component to tell the mqtt client which mqtt broker to connect to (host and port). The setting should be independent to any of the "binding" logic, as it enables thin-edge components to be deployed in independent containers.
The following settings should be supported.
127.0.0.1
string
(could be a hostname or ip!)1883
int
?mqtt.client.host
should be a string and not an IPAddress type so that it will also support hostnames/dns names, as an external mqtt broker is most likely going to be referenced by a dns name or hostname instead of an ip address!The settings above would translate to the following snippet in the
/etc/tedge/tedge.toml
file:In terms of usage of the new mqtt client settings, the host/port should be read from the configuration, and used in the creation of each mqtt client in every service (e.g.
tedge-agent
,tedge-mapper-*
,c8y-log-plugin
,c8y-configuration-plugin
etc.)File: plugins/c8y_log_plugin/src/main.rs:90
The following shows a modified version of the code showing the usage when creating the mqtt client
Describe alternatives you've considered
Additional context
I am aware that this will technically be a breaking change, however since it was not easy to configure an external broker anyway, I don't think the impact will be large. Generally I think the new settings will be easier for users to understand and configure when wanting to connect thin-edge to an external mqtt broker.
The text was updated successfully, but these errors were encountered: