Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [paho-dev] On Paho's opinionated URI validation

Andy

I agree this is something that should be standardised.

Paul


On 4 November 2013 19:39, Andy Piper <andypiperuk@xxxxxxxxx> wrote:
I think parts of those changes are sensible. You're not missing anything, this is just code that could be improved. I think making tcp:// and mqtt:// synonyms makes some sense.

One thing I would note though, since MQTT-S (soon to be MQTT-SN) exists, you may want to rethink the mqtts:// as an alias for ssl:// ... that's a little more tricky.

In general the Paho Java client code for URI handling is very brittle right now. I raised this as a bug a while ago https://bugs.eclipse.org/bugs/show_bug.cgi?id=405721 and I know Al made some initial changes.

One thing I would like to ensure is that whatever scheme is adopted, and your patch may contribute to changing (probably easiest to attach a patch to the existing Bugzilla report)... we should try to ensure that all of our language clients are equally capable of understanding that scheme.

There's no standard MQTT scheme today, although IIRC once upon a time, one of the IBM products did informally support one. I know that some of the other third-party clients out there have adopted their own, too (mqtt+nio etc). There is an IANA-assigned port number but currently officially listed by an old name (1883 = ibm-mqisdp, precursor name to MQTT, 8883 = secure-mqtt .... there's also mqtt listed as assigned to AndySC without a port number, but with a TXT record |Defined TXT keys: topics=<open topic to subscribe to for information>, eg topic=/info|). In my opinion, definitely something to be proposed for wrapping up in the OASIS work.

Thanks for raising this - useful as well in the light of the MQTT Interop testing discussion in another thread!

Andy





On Mon, Nov 4, 2013 at 7:00 PM, Michael Klishin <michael.s.klishin@xxxxxxxxx> wrote:
I maintain Machine Head [1] and work on a project that provides
applications with URI's to connect to an MQTT capable broker
(RabbitMQ).

I generally find Paho Java a pretty nice library but a couple of things
stand out as odd usability issues.

One of them is URI validation that Paho performs. Here's the exact
code that does it:

https://gist.github.com/michaelklishin/71eaeb702a7af4a20c41

This raises two questions:

 * Why is there no standard mqtt:// scheme? This is very inconvenient for e.g. PaaS service providers that provide URI's that developers should use.
 * Why won't Paho accept tcp://127.0.0.1:1883 but not tcp://127.0.0.1:1883/ (with a trailing slash)

tcp://127.0.0.1:1883 and tcp://127.0.0.1:1883/ are technically two different URI's but it's
pretty easy to see how a user may provide either and expect the same result.

Am I missing something? Would a patch that makes Paho treat
both "" and "/" as valid paths be accepted? What about a patch
that makes "mqtt" an alias for "tcp" and "mqtts" an alias for "ssl"?
Just to make it clear: both will not introduce any breaking changes.

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev




--
Andy Piper | Kingston upon Thames, London (UK)
blog: http://andypiper.co.uk   |   skype: andypiperuk
twitter: @andypiper  |  images: http://www.flickr.com/photos/andypiper

_______________________________________________
paho-dev mailing list
paho-dev@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/paho-dev




--
Paul Fremantle
Part-time PhD student - School of Computing
twitter: pzfreo / skype: paulfremantle / blog: http://pzf.fremantle.org
CTO and Co-Founder, WSO2
OASIS WS-RX TC Co-chair, Apache Member
07740 199 729

Back to the top