-
Notifications
You must be signed in to change notification settings - Fork 42
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
Adding a retain flag supported by mqtt in the gateway and status topi… #237
base: master
Are you sure you want to change the base?
Conversation
@@ -60,11 +61,13 @@ | |||
file_vars["gateway_version"] = env_vars["WM_GW_VERSION"] | |||
file_vars["ignored_endpoints_filter"] = env_vars["WM_GW_IGNORED_ENDPOINTS_FILTER"] | |||
file_vars["whitened_endpoints_filter"] = env_vars["WM_GW_WHITENED_ENDPOINTS_FILTER"] | |||
file_vars["mqtt_retain_flag_supported"] = env_vars["WM_SERVICES_MQTT_RETAIN_FLAG_SUPPORTED"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
line too long (92 > 79 characters)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just a minor comment from, otherwise looks good.
…cs in mqtt. Some brokers (like AWS iot core) do not support retain messages. Add option to transport to specify if the retain is supported by broker. New MQTT topics can be used in the case where the mqtt broker does not support retained message and we would like to know the status of the gateways as soon as possible. The concerned topics in the mqtt broker are : gw-request/get_gw_status gw-response/get_gw_status/<gw-id>/<sink-id>
643764f
to
3637f84
Compare
…tus branch to suppress it and simplify branches) + PR#236
@@ -60,11 +61,13 @@ | |||
file_vars["gateway_version"] = env_vars["WM_GW_VERSION"] | |||
file_vars["ignored_endpoints_filter"] = env_vars["WM_GW_IGNORED_ENDPOINTS_FILTER"] | |||
file_vars["whitened_endpoints_filter"] = env_vars["WM_GW_WHITENED_ENDPOINTS_FILTER"] | |||
file_vars["mqtt_retain_flag_not_supported"] = env_vars["WM_SERVICES_MQTT_RETAIN_FLAG_NOT_SUPPORTED"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Black would make changes.
line too long (100 > 79 characters)
@@ -227,6 +291,18 @@ def __init__(self, settings, **kwargs): | |||
else: | |||
self.data_event_id = None | |||
|
|||
if not self.retain_supported: | |||
logging.info("Gateway status is sent every %d seconds", settings.mqtt_send_gateway_status_period_s) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (111 > 79 characters)
|
||
self.mqtt.add_argument( | ||
"--mqtt_send_gateway_status_period_s", | ||
default=os.environ.get("WM_SERVICES_MQTT_SEND_GATEWAY_STATUS_PERIOD_S", 20), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)
@@ -363,6 +363,31 @@ def add_mqtt(self): | |||
), | |||
) | |||
|
|||
self.mqtt.add_argument( | |||
"--mqtt_retain_flag_not_supported", | |||
default=os.environ.get("WM_SERVICES_MQTT_RETAIN_FLAG_NOT_SUPPORTED", False), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
line too long (88 > 79 characters)
…cs in mqtt.
Some brokers (like AWS iot core) do not support retain messages. Add option to transport to specify if the retain is supported by broker.
New MQTT topics can be used in the case where the mqtt broker does not support retained message and we would like to know the status of the gateways as soon as possible.
The concerned topics in the mqtt broker are :
gw-request/get_gw_status
gw-response/get_gw_status//
Closes # .
Brief pull request description