Put uEntity instance ID into dedicated topic segment#254
Conversation
…egment The uEntity type and instance IDs contained in the ue_id field of a UMessage are now being put into separate segments of topic names and filters to support accepting any uEntity instance ID in topic filters. Additionally, the mappign of UAttributes::ttl has been changed to use the standard Message Expiry Interval property of the MQTT 5 PUBLISH packet instead of using a User Property. This allows for taking advantage of an MQTT broker's message expiration functionality.
|
@jjj-vtm @ValMobBIllich would you mind taking a look? |
|
Makes sense to me! I checked and at the very least azures eventgrids support the message_expiry feature. For the topics Im still not understanding the logic of what gets mapped where. Maybe Im missing some part of what the UID means. |
The uEntity identifier of a UUri is a u32, the 16 LSBs represent the service type while the 16 MSB represent the service instance. The uEntity ID The uEntity ID With the instance ID in its dedicated topic segment, we can now filter on a specific service instance or accept all instance IDs using the MQTT topic wildcard character ( |
|
That makes sense now thanks! I went ahead and created a small PR to implement these changes also on the transport side here: eclipse-uprotocol/up-transport-mqtt5-rust#17 |
|
@PLeVasseur would you mind taking a look? |
PLeVasseur
left a comment
There was a problem hiding this comment.
Hey @sophokles73 -- LGTM. Left a question under the Connection Handling section, as I'm not too familiar with MQTT, but I think this section was already there. More a curiosity.
|
|
||
| |=== | ||
|
|
||
| == Connection Handling |
There was a problem hiding this comment.
Is this, let's say, a typical strategy? I'm not familiar with MQTT 😅
There was a problem hiding this comment.
Using an exponential backoff for trying to connect is a widely adopted (generic) strategy.
The hints regarding the options are MQTT specific and mostly depend on the use case.
The uEntity type and instance IDs contained in the ue_id field of
a UMessage are now being put into separate segments of topic names and
filters to support accepting any uEntity instance ID in topic filters.
Additionally, the mappign of UAttributes::ttl has been changed to use
the standard Message Expiry Interval property of the MQTT 5 PUBLISH
packet instead of using a User Property. This allows for taking
advantage of an MQTT broker's message expiration functionality.