Uploaded image for project: 'Beam'
  1. Beam
  2. BEAM-9647

No MQTT connection possible because clientId is too long

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • P1
    • Resolution: Fixed
    • 2.19.0, 2.20.0
    • 2.21.0
    • io-java-mqtt
    • None

    Description

      The used FuseSource MQTT library only supports (outdated) MQTT version 3.1. According to MQTT v3.1 protocol (https://public.dhe.ibm.com/software/dw/webservices/ws-mqtt/mqtt-v3r1.html#connect) a clientId must be <= 23 characters, otherwise the connection must be rejected by the server. However, in MqttIO (https://github.com/apache/beam/blob/master/sdks/java/io/mqtt/src/main/java/org/apache/beam/sdk/io/mqtt/MqttIO.java#L223) the clientId is always appended with a random UUID which itself is longer than 23 characters. This implies that establishing a connection this way should never work.

      FYI: If you don't encounter this error when testing it may be because some servers do not correctly implement the standard and accept connections with a clientId longer than 23 characters (e.g. HiveMQ) or crash and/or don't respond to such connection requests at all.

      Attachments

        Issue Links

          Activity

            People

              mjacoby Michael Jacoby
              mjacoby Michael Jacoby
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 40m
                  40m