-
Type:
Improvement
-
Status:
Closed
-
Priority:
Minor
-
Resolution:
Fixed
-
Affects Version/s:
3.1.1
-
-
-
-
-
Proposal:
Hide
Non-normative:
A client implementation may provide a convenience method to generate a random Client Identifier. Use of such a method should be actively discouraged when the Clean Session flag is set to 0.
Show
Non-normative:
A client implementation may provide a convenience method to generate a random Client Identifier. Use of such a method should be actively discouraged when the Clean Session flag is set to 0.
Opened on behalf of Roger Light:-
Hi,
A lot of MQTT client libraries offer the feature of generating random
client ids rather than having to supply one. This is good.
I recently had over 10,000 client connections made to
test.mosquitto.org using a random client id, but also having set clean
session to false, which meant that when they disconnected their
information was stored on the server but there was basically no chance
they could reconnect.
It would be nice to have a comment in the spec suggesting that
implementations may offer to generate random client ids but that they
must refuse to do so if clean session is set to false.
Cheers,
Roger
{"report":{"apdex":0.5,"isInitial":true,"journeyId":"32d328b8-ff3f-4da7-9bdf-ff07d4635ac3","key":"jira.project.issue.view-issue","navigationType":0,"readyForUser":3354.5,"redirectCount":0,"resourceLoadedEnd":3179.5999999046326,"resourceLoadedStart":272.69999980926514,"resourceTiming":[{"duration":37.40000009536743,"initiatorType":"link","name":"https://issues.oasis-open.org/s/3edeca31ab9ba77980aae0809fbe7121-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/css/_super/batch.css","startTime":272.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":272.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":310.09999990463257,"responseStart":0,"secureConnectionStart":0},{"duration":38,"initiatorType":"link","name":"https://issues.oasis-open.org/s/7d2823769c2e7b66e860863fe879b7f8-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/css/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.css?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&richediton=true","startTime":273,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":273,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311,"responseStart":0,"secureConnectionStart":0},{"duration":38.299999713897705,"initiatorType":"link","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.css","startTime":273.09999990463257,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":273.09999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.3999996185303,"responseStart":0,"secureConnectionStart":0},{"duration":38.40000009536743,"initiatorType":"link","name":"https://issues.oasis-open.org/s/645acc233eb869f48a571293b8358a7d-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static-adgs/jira.webresources:global-static-adgs.css","startTime":273.2999997138977,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":273.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":311.69999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":38.799999713897705,"initiatorType":"link","name":"https://issues.oasis-open.org/s/a0dd6509771c1de0667aae5429c04cda-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:global-static/jira.webresources:global-static.css","startTime":273.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":273.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":312.2999997138977,"responseStart":0,"secureConnectionStart":0},{"duration":1207.4000000953674,"initiatorType":"script","name":"https://issues.oasis-open.org/s/e5479157e7a0c08b005e6522f2f04104-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/0a4716d29b2d5b1bdcdb168b4efc119e/_/download/contextbatch/js/_super/batch.js?locale=en-US","startTime":273.59999990463257,"connectEnd":1240.1999998092651,"connectStart":1190.3999996185303,"domainLookupEnd":1190.3999996185303,"domainLookupStart":1190.3999996185303,"fetchStart":273.59999990463257,"redirectEnd":0,"redirectStart":0,"requestStart":1240.2999997138977,"responseEnd":1481,"responseStart":1279.3999996185303,"secureConnectionStart":1214.8999996185303},{"duration":2905.800000190735,"initiatorType":"script","name":"https://issues.oasis-open.org/s/83514d5d4e8543747b02042eafcdc99c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/9aebb1c0aaa4c36289529757ec9dbb54/_/download/contextbatch/js/project.issue.navigator,jira.view.issue,jira.global,atl.general,-_super/batch.js?agile_global_admin_condition=true&jag=true&jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":273.7999997138977,"connectEnd":1363.6999998092651,"connectStart":1313.7999997138977,"domainLookupEnd":1313.7999997138977,"domainLookupStart":1313.7999997138977,"fetchStart":273.7999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1363.6999998092651,"responseEnd":3179.5999999046326,"responseStart":1392.8999996185303,"secureConnectionStart":1338.5},{"duration":1039.8999996185303,"initiatorType":"script","name":"https://issues.oasis-open.org/s/70bb2263e59e7e1f04fbd137c80b895b-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/aae1242f5fc81cc6a5bb8bc963ccda29/_/download/contextbatch/js/atl.global,-_super/batch.js?locale=en-US","startTime":274,"connectEnd":1286.6999998092651,"connectStart":1237.5,"domainLookupEnd":1237.5,"domainLookupStart":1237.5,"fetchStart":274,"redirectEnd":0,"redirectStart":0,"requestStart":1286.7999997138977,"responseEnd":1313.8999996185303,"responseStart":1313.1999998092651,"secureConnectionStart":1261.7999997138977},{"duration":1284.1999998092651,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-en/jira.webresources:calendar-en.js","startTime":274.19999980926514,"connectEnd":1530.5999999046326,"connectStart":1480.7999997138977,"domainLookupEnd":1480.7999997138977,"domainLookupStart":1480.7999997138977,"fetchStart":274.19999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":1530.6999998092651,"responseEnd":1558.3999996185303,"responseStart":1557.5,"secureConnectionStart":1505.5},{"duration":1362.4000000953674,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:calendar-localisation-moment/jira.webresources:calendar-localisation-moment.js","startTime":274.2999997138977,"connectEnd":1608.2999997138977,"connectStart":1558.2999997138977,"domainLookupEnd":1558.2999997138977,"domainLookupStart":1558.2999997138977,"fetchStart":274.2999997138977,"redirectEnd":0,"redirectStart":0,"requestStart":1608.3999996185303,"responseEnd":1636.6999998092651,"responseStart":1635.3999996185303,"secureConnectionStart":1583.0999999046326},{"duration":1439.6999998092651,"initiatorType":"script","name":"https://issues.oasis-open.org/s/cda37faab827dbdf305de8efe8282062-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/8.0.5/_/download/batch/com.atlassian.auiplugin:split_aui.pattern.label/com.atlassian.auiplugin:split_aui.pattern.label.js?locale=en-US","startTime":274.5,"connectEnd":1686.1999998092651,"connectStart":1636.6999998092651,"domainLookupEnd":1636.6999998092651,"domainLookupStart":1636.5999999046326,"fetchStart":274.5,"redirectEnd":0,"redirectStart":0,"requestStart":1686.2999997138977,"responseEnd":1714.1999998092651,"responseStart":1713.3999996185303,"secureConnectionStart":1661.1999998092651},{"duration":43.30000019073486,"initiatorType":"link","name":"https://issues.oasis-open.org/s/07245784f53abc49bad9d9d4d36c577a-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/cadc4f20cc5c138dee060d42cf85f220/_/download/contextbatch/css/jira.global.look-and-feel,-_super/batch.css","startTime":274.69999980926514,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":274.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":318,"responseStart":0,"secureConnectionStart":0},{"duration":1517.3000001907349,"initiatorType":"script","name":"https://issues.oasis-open.org/rest/api/1.0/shortcuts/803004/a29179d70fa8562374ee16707692af77/shortcuts.js?context=issuenavigation&context=issueaction","startTime":274.8999996185303,"connectEnd":1763.8999996185303,"connectStart":1714.0999999046326,"domainLookupEnd":1714.0999999046326,"domainLookupStart":1714.0999999046326,"fetchStart":274.8999996185303,"redirectEnd":0,"redirectStart":0,"requestStart":1764,"responseEnd":1792.1999998092651,"responseStart":1790.8999996185303,"secureConnectionStart":1738.7999997138977},{"duration":17.699999809265137,"initiatorType":"link","name":"https://issues.oasis-open.org/s/f77fd89aa211a76b20e9b0e63564383c-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/css/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.css?jira.create.linked.issue=true&richediton=true","startTime":309.5,"connectEnd":0,"connectStart":0,"domainLookupEnd":0,"domainLookupStart":0,"fetchStart":309.5,"redirectEnd":0,"redirectStart":0,"requestStart":0,"responseEnd":327.19999980926514,"responseStart":0,"secureConnectionStart":0},{"duration":1719.3000001907349,"initiatorType":"script","name":"https://issues.oasis-open.org/s/41525c48ddceeb9b11e54085268fc285-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/4a9288299d147101bf66484f4be48925/_/download/contextbatch/js/com.atlassian.jira.projects.sidebar.init,-_super,-jira.view.issue,-project.issue.navigator/batch.js?jira.create.linked.issue=true&locale=en-US&richediton=true","startTime":309.69999980926514,"connectEnd":2000.0999999046326,"connectStart":1949.8999996185303,"domainLookupEnd":1949.8999996185303,"domainLookupStart":1949.8999996185303,"fetchStart":309.69999980926514,"redirectEnd":0,"redirectStart":0,"requestStart":2000.2999997138977,"responseEnd":2029,"responseStart":2028.1999998092651,"secureConnectionStart":1974.5999999046326},{"duration":2283,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-js/jira.webresources:bigpipe-js.js","startTime":326,"connectEnd":2578.2999997138977,"connectStart":2528.2999997138977,"domainLookupEnd":2528.2999997138977,"domainLookupStart":2528.2999997138977,"fetchStart":326,"redirectEnd":0,"redirectStart":0,"requestStart":2578.5,"responseEnd":2609,"responseStart":2607.3999996185303,"secureConnectionStart":2553.0999999046326},{"duration":2232.699999809265,"initiatorType":"script","name":"https://issues.oasis-open.org/s/d41d8cd98f00b204e9800998ecf8427e-CDN/nu8zej/803004/aeedb5937bed650f2f0cc4ec9ceaa5d3/1.0/_/download/batch/jira.webresources:bigpipe-init/jira.webresources:bigpipe-init.js","startTime":375.5,"connectEnd":2578.7999997138977,"connectStart":2528.8999996185303,"domainLookupEnd":2528.8999996185303,"domainLookupStart":2528.8999996185303,"fetchStart":375.5,"redirectEnd":0,"redirectStart":0,"requestStart":2578.8999996185303,"responseEnd":2608.199999809265,"responseStart":2606.7999997138977,"secureConnectionStart":2553.5},{"duration":706,"initiatorType":"xmlhttprequest","name":"https://issues.oasis-open.org/rest/webResources/1.0/resources","startTime":1619.5999999046326,"connectEnd":2295,"connectStart":2245.3999996185303,"domainLookupEnd":2245.3999996185303,"domainLookupStart":2245.3999996185303,"fetchStart":1619.5999999046326,"redirectEnd":0,"redirectStart":0,"requestStart":2295.0999999046326,"responseEnd":2325.5999999046326,"responseStart":2324.8999996185303,"secureConnectionStart":2269.8999996185303}],"threshold":1000,"fetchStart":0,"domainLookupStart":28,"domainLookupEnd":38,"connectStart":38,"connectEnd":123,"secureConnectionStart":64,"requestStart":123,"responseStart":266,"responseEnd":376,"domLoading":271,"domInteractive":3417,"domContentLoadedEventStart":3417,"domContentLoadedEventEnd":3483,"domComplete":3607,"loadEventStart":3607,"loadEventEnd":3609,"userAgent":"Mozilla/5.0 AppleWebKit/537.36 (KHTML, like Gecko; compatible; ClaudeBot/1.0; +claudebot@anthropic.com)","marks":[],"measures":[],"correlationId":"12bf273535e38c","effectiveType":"4g","downlink":9,"rtt":0,"serverDuration":220,"dbReadsTimeInMs":24,"dbConnsTimeInMs":93,"applicationHash":"4d4040e0714d65b7fffa4801569d014c0b16eaa9","experiments":[]}}
I'd been thinking about this problem/situation and how instead it might solved on the server side. For example a client connecting with clean session false and a 0 length clientId would be saying; "I don't care about my state I just want to connect and send/receive data", in this case the server can handle either assigning it internally a guaranteed unique clientId or managing it in some other way, but the client implementation doesn't need to know/care about the details or attempt to generate a clientId it hopes will be unique.
This is probably a change beyond the scope of the charter, but as it's related to the above I figure it's worth mentioning here.