Uploaded image for project: 'OASIS Message Queuing Telemetry Transport (MQTT) TC'
  1. OASIS Message Queuing Telemetry Transport (MQTT) TC
  2. MQTT-612

Publish does not allow topic registration

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major
    • Resolution: No Action
    • Affects Version/s: MQTT-SN-1.2
    • Fix Version/s: None
    • Component/s: MQTT-SN
    • Labels:
      None

      Description

      When using subscribe, an implicit registration of a topic alias is done (if the topic filter contains no wildcards). This is not done for publish, where a REGISTER must be used beforehand.

      In MQTT 5, topic alias registration is done with a publish. If we allow topic registration on a publish (not QoS -1), we will be aligning with MQTT 5, and reducing the need for using REGISTER/REGACK exchanges.

      Note that MQTT 5 states:

      The Topic Alias mappings used by the Client and Server are independent from each other. Thus, when a Client sends a PUBLISH containing a Topic Alias value of 1 to a Server and the Server sends a PUBLISH with a Topic Alias value of 1 to that Client they will in general be referring to different Topics.

      I believe we should adopt the same approach in MQTT-SN (it's not clear from the 1.2 specification). That would mean changing the PUBLISH packet to always include both  topic alias and topic length fields, using them in the same manner as MQTT 5. Specifically this:

      The sender decides whether to use a Topic Alias and chooses the value. It sets a Topic Alias mapping by including a non-zero length Topic Name and a Topic Alias in the PUBLISH packet. The receiver processes the PUBLISH as normal but also sets the specified Topic Alias mapping to this Topic Name.

       If a Topic Alias mapping has been set at the receiver, a sender can send a PUBLISH packet that contains that Topic Alias and a zero length Topic Name. The receiver then treats the incoming PUBLISH as if it had contained the Topic Name of the Topic Alias.

       

        Attachments

          Activity

            People

            • Assignee:
              simon622867 Simon Johnson
              Reporter:
              ian.craggs Ian Craggs
            • Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: