Today I'm announcing the prerelease of bish-bosh.
bish-bosh is a MIT-licensed shell script client for
MQTT 3.1.1 that runs
without installation
on any POSIX system on any POSIX shell: Linux, Mac OS X, Cygwin, AIX,
FreeBSD, OpenBSD and NetBSD are all known to work, as are the
DASH,
GNU Bash and
BusyBox shells.
There are usually no dependencies at all if you're using BusyBox. For everything else, it's a
very minimal set of helper programs that even the most basic of POSIX-compatible systems should have. Installation can be as simple as
cp bish-bosh /path/to
. It'll run on your router, high-end server, your smart phone, laptop or even an unlocked BT fibre modem. It supports QoS 0 - 2, retransmission on re-connect, will messages,
retain, ping, err, nearly everything really, bar a few very minor edge cases
(
https://github.com/raphaelcohn/bish-bosh#specification-violations).
bish-bosh is available on GitHub:
https://github.com/raphaelcohn/bish-boshReleases are at
https://github.com/raphaelcohn/bish-bosh/releasesThere's an extensive README.md at
https://github.com/raphaelcohn/bish-boshIt's a command interpreter that can be used to script MQTT sessions, or built into bigger standalone programs. For example:-
#!/usr/bin/env bish-bosh
bishbosh_server='test.mosquitto.org'
bishbosh_clientId='my-client-id'
# We've got a message
bishbosh_connection_handler_PUBLISH()
{
# bish-bosh handles QoS 1 and 2 for us
# bish-bosh wires stdout to be data to send, so we need to redirect to stderr
printf '%s' "Received a message on topic ${topicName} which was ${messageLength} byte(s) long and is in the file ${messageFilePath}" 1>&2
# clean up
rm "${messageFilePath}"
}
Partly, it was written because I like software that can be used without installation, anywhere. And partly, as MQTT Co-Chair, I really wanted to show the wider audience aware of MQTT that it's a such a simple, robust protocol we've all had a hand in making that it can be implemented in almost anything and run almost anywhere.
I'm open to widespread re-use - if folks want to incorporate in Mosquitto packages or Paho, for example, please do - just respect the license, and, if you can, give acknowledgment. I really want folks to contribute and make bish-bosh better, so here are some requests:-
* Would a broker variant be useful to you? It'd certainly be cool, and ultra-portable
* Does anyone have a modern HP-UX set up, or access to all supported HP-UX versions, to see what breaks (HP-UX is suitably weird)?
* Does anyone want to try this out with Open-Wrt or Tomato?
* Can someone check for Gentoo and Arch Linux compatbility?
* I can't install DragonFlyBSD on my hypervisor (Parallels) - can anyone check if it works there?
* Likewise, I can't get MINIX 3 to talk to a network
* Is anyway out there an expert with Solaris 10 or 11? Can you see if there's a way we can make this work without the workarounds?
* Does anyone care about yash?
* Would someone like to add it to the
mqtt.org list?
I'm minded to post a link to Hacker News later. If you like bish-bosh, then please star it on GitHub or vote it up on Hacker News if I do post ('Show HN:'). It's good not just for bish-bosh, but to raise awareness of MQTT. Half of all good applications should use message queuing; most don't, simply because their developers are simply unaware.
Raph