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

ADD MQTT retain feature #4412

Merged
merged 7 commits into from
Aug 31, 2023
Merged

ADD MQTT retain feature #4412

merged 7 commits into from
Aug 31, 2023

Conversation

fgalan
Copy link
Member

@fgalan fgalan commented Aug 30, 2023

Issue #4388

  • CRUD of the new field
  • Effectively use the new field to publish MQTT notifications
  • .test covering the CRUD functionality
  • doc
  • CNR
  • Align existing .test with the new GET subscription(s) output - 19f3d2c + 9789d5b
  • Effectively test the new functionality (.test or manual testing?) - 19f3d2c

Comment on lines +286 to +287
- **topic**: MQTT topic (only in MQTT notifications)
- **qos**: MQTT QoS value (only in MQTT notifications)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Taking into account this at src/lib/mongoBackend/dbConstants.h

#define CSUB_MQTTTOPIC               "topic"
#define CSUB_MQTTQOS                 "qos"

It seems mqttQoS and mqttTopic was a typo.

NTC (informative)

@fgalan fgalan changed the title [WIP] ADD MQTT retain feature ADD MQTT retain feature Aug 30, 2023
@fgalan fgalan requested a review from mapedraza August 30, 2023 13:29
Copy link
Collaborator

@mapedraza mapedraza left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@mapedraza
Copy link
Collaborator

mapedraza commented Aug 30, 2023

Seems those tests need to be updated adding retain field
https://github.com/telefonicaid/fiware-orion/blob/2f74717b415fbebaf163dad21544711995d17697/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_notifications_auth.test

https://github.com/telefonicaid/fiware-orion/blob/2f74717b415fbebaf163dad21544711995d17697/test/functionalTest/cases/3914_mqtt_notifications_auth/mqtt_custom_notifications_auth.test

@@ -53,13 +53,13 @@
[853](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:854)
 05. GET subs checking user1 but password offuscated
[854](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:855)
 ===================================================
[855](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:856)
 HTTP/1.1 200 OK
[856](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:857)
-Date: REGEX(.*)
[857](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:858)
-Fiware-Correlator: REGEX([0-9a-f\-]{36})
[858](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:859)
+Date: Wed, 30 Aug 2023 13:36:33 GMT
[859](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:860)
+Fiware-Correlator: 3bd9e520-473a-11ee-836e-6045bde3459b
[860](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:861)
 Content-Type: application/json
[861](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:862)
-Content-Length: 351
[862](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:863)
+Content-Length: 366
[863](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:864)
 
[864](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:865)
 {
[865](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:866)
-    "id": "REGEX([0-9a-f\-]{24})",
[866](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:867)
+    "id": "64ef45e19cdd8ac0b40762ea",
[867](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:868)
     "notification": {
[868](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:869)
         "attrs": [],
[869](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:870)
         "attrsFormat": "normalized",
[870](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:871)
@@ -67,6 +67,7 @@
[871](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:872)
         "mqttCustom": {
[872](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:873)
             "passwd": "*****",
[873](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:874)
             "qos": 0,
[874](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:875)
+            "retain": false,
[875](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:876)
             "topic": "/orion",
[876](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:877)
             "url": "mqtt://localhost:1883",
[877](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:878)
             "user": "user1"
[878](https://github.com/telefonicaid/fiware-orion/actions/runs/6025542138/job/16346471518?pr=4412#step:4:879)
@@ -98,21 +99,21 @@

@fgalan
Copy link
Member Author

fgalan commented Aug 30, 2023

@fisuda this PR does some modifications to the English documentation. It would be great if you could sync the Japanese translation in a PR (using either feature/4388_mqtt_retain or master as base branch, as you prefer), please. Thanks in advance!

@fisuda
Copy link
Contributor

fisuda commented Aug 31, 2023

I sent the PR #4413 to the feature/4388_mqtt_retain branch.
Thanks.

fgalan and others added 2 commits August 31, 2023 09:26
@mapedraza mapedraza merged commit 38b88b2 into master Aug 31, 2023
12 checks passed
@mapedraza mapedraza deleted the feature/4388_mqtt_retain branch August 31, 2023 08:07
@fgalan fgalan mentioned this pull request Aug 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants