Tag Archives: mac os x

OS X mosquitto “bites”…

In my post last week about the new MQTT support coming to WebSphere MQ I very briefly mentioned that there are some third-party tools that already implement MQTT. One of those I pointed to is the very neat mosquitto broker, a project started by Roger Light.

mosquitto has been around for a while now and is aiming to replicate the functionality of the Really Small Message Broker that is on IBM alphaWorks. One of the neat things about it, from my point of view, is that it there is an Ubuntu PPA repository, so with a couple of apt commands, I can install a running MQTT broker and build my own applications independently (NB there are packages for other Linux distros too, as well as Windows). When I want to do some “heavy lifting” or share data with my ESB, I connect up my local mosquitto broker to pass messages across to WebSphere MQ through the new telemetry channels – because MQTT supports a concept of bridges, and both RSMB and mosquitto both include support for bridging.

I noticed that there wasn’t yet a version available for Mac OS X but figured that it shouldn’t be too difficult to compile and run it on that platform. As it happens, it did turn into a bit of an adventure for a couple of reasons, but at least I learned from the experience. If you’re desperate to build yourself a version to try some MQTT development on the Mac, here’s what I had to do to get it going on Snow Leopard:

  1. Installed mercurial, and a GUI for it called Murky (which requires the hg command line tool from the base mercurial package). The sources for mosquitto are in bitbucket, a Mercurial repository… this is optional of course as I could have just used a source tarball.
  2. Grabbed the latest mosquitto source from bitbucket.
  3. Modified the Makefiles throughout the mosquitto tree to build libraries with a .dylib instead of a .so extension (the default on OS X), and also changed the -soname parameter to -install_name which the OS X version of gcc understands.
  4. At this point the compile was starting to show progress… but failing due to missing symbols… the offender being one from sqlite, _sqlite_enable_load_extension. Turns out that the version of sqlite shipped in OS X 10.6.x is 3.5.4 but it does not have extension loading functionality built in, as evidenced by nm -g /usr/lib/libsqlite3.dylib | grep 'sqlite3_enable'
  5. Downloaded sqlite3.8.0, configured it to install to /usr/local (to avoid overwriting the default OS X shipped version), and built and installed it with no issues.
  6. At this point the compile was pretty smooth, once I modded Makefile link and include lines to point to the new version of sqlite in /usr/local. The only thing that failed was documentation, but that was “optional” 🙂
  7. Trying to start the broker failed… because it was trying to load the sqlite3-pcre extension.
  8. Installed git (the source for the sqlite3-pcre extension is in a git repository).
  9. Grabbed the source for sqlite3-pcre and built and installed it using:
    gcc -shared -o pcre.so -L/usr/local/lib -lsqlite3
              -lpcre -Werror pcre.c -I/usr/local/include
    sudo mkdir /usr/local/lib/sqlite3
    sudo cp pcre.so /usr/local/lib/sqlite3
  10. The final issue was that the path to the pcre extension is hard-coded into mosquitto/src/conf.c so I modded that to point at the version in /usr/local and recompiled. I’m assuming that this would not generally be required, but it worked as a hack to get me going!
    D’oh. Just realised that this is precisely what the ext_sqlite_regex variable in the mosquitto.conf file is for. Shouldn’t have bothered!

So that was it. Being fair, if I hadn’t been feeling my way through that, I would have installed git and mercurial, grabbed all the lib sources for sqlite3 and pcre and built them, built mosquitto, and been good to go. At this point, the broker and test clients are runnable (assuming the library paths are set up appropriately):

DYLD_LIBRARY_PATH=/usr/local/lib ./mosquitto
DYLD_LIBRARY_PATH=../lib ./mosquitto_pub -t test/andy
        -m "hello world"

If you are interested in seeing this in action, here’s a short (and silent, but annotated) screencast:

The Java GUI application you see in the screencast is the test client shipped in an old IBM SupportPac, IA92, a Java implementation of MQTT. The final release of the WebSphere MQ Telemetry component for WebSphere MQ will contain something similar, considerably enhanced and integrated into WebSphere MQ Explorer.

In other news, Roger recently announced version 0.8 of mosquitto, which now has slightly different packaging and includes C, C++ and Python clients. I hope to give these a test drive shortly!

Advertisements

Thoughts on Google Chrome OS

I’ve resisted writing anything on the recently-announced Google Chrome OS, for a number of reasons… the most significant one being that so far, we don’t know a huge amount about it. This hasn’t stopped reams of opinion being written or spoken about it anywhere else though, so a week on from the announcement, I thought I’d lay down a few opinions of my own.

First of all, I always felt that the Chrome browser itself kind of pointed towards an operating system, since the engineers were clearly thinking in terms that you’d usually associate with an OS – ideas like the threading model immediately made me think of the domain of the operating system. The “Google OS” has been one of those rumours that has consistently failed to die.

So what do we know? We know that Google Chrome OS will be based on Linux and will be largely open source, and that the initial target constituency will be the netbook market but that it has ambitions to the desktop. We know that it will have a new windowing system (bye bye X). We hear that Google has been courting various netbook manufacturers, and we know that it should be out sometime in 2010.

On the threat to the desktop

Scott Bourne was saying on MacBreak Weekly this week that he felt this meant it would be no real threat to Mac OS X, and I guess the ensuing discussion really sparked the majority of this post. Scott based his assertion on a straw poll of people who he’d asked “OS X or Chrome?” (a: OS X) for laptops, and “Chrome or Windows Mobile?” (a: Chrome) for PDAs. I just think that’s an impossible discussion right now. So far it’s vapourware. We don’t know what Google Chrome OS will look like and we don’t know what features it will have. It’s pointless to try to compare it to existing operating systems at this stage.

The other reason the MacBreak Weekly crew decided that Chrome OS wouldn’t be a threat was that it would initially be limited to netbooks but “will it actually be able to make the step up to the desktop?”. This is an interesting discussion, as it assumes that the granddaddy / holy grail of machines is the desktop computer. But… wait a minute. Haven’t Apple spent the past two years convincing the whole mobile market that they have to have fully-capable computing platforms on their handheld devices? Isn’t the netbook market exploding? Aren’t laptops outselling desktops? Aren’t computers and televisions converging via set-top boxes and streaming media? People want computing power and access wherever they are, in a form factor that fits. I think the suggestion that the desktop is still “where its at” is deeply, deeply flawed – the desktop is dying, and has been for a long time. The desktop is a place where people occasionally anchor themselves, but the rest of the time they are moving around and taking their platform with them.

So is it a threat? On netbooks, in my opinion, yes – probably to both Linux and Windows. As for Apple, they aren’t going to be keen to let anyone run another OS on their hardware, and they’re not currently in the netbook market, so it probably is not a big deal right now. Windows XP still seems to be an OS of choice on many netbooks, but Microsoft probably will finally kill that with Windows 7. There are too many Linux distributions around (Linpus, Moblin, Ubuntu) vying for a slice of that market. The Google brand, combined with an experience that is genuinely pleasant, could take chunks out of both sides of that market. From there, who knows… but if it is Linux-based, we already know that that scales from big to small machines, so there are plenty of places it could go. I personally think it will be interesting to see where they choose to go with the user interface, and this is the area that will determine the future.

On the cloud

I think the idea that Chrome OS could be a lightweight system with the majority of content hosted in the cloud is particularly interesting. How secure are we all feeling this week about the safety of the cloud? In the light of the Twitter hack, I imagine that people are rethinking the security of the public cloud, anyway. Paired with a secure behind-the-firewall private cloud, a lightweight OS like this makes a lot of sense. That’s not to say I don’t like the flexibility that cloud/web-based services offer me – I use many of them, including things like Google Docs. Of course, you need a network connection for it to be effective, and it’s true that bandwidth is becoming pervasive, although if you take a look at 3G coverage for various UK mobile operators (hint, look at the PDF and the maps *per operator*, not the overall coverage map), you might want to rethink your dependence on that, too.

On the image

Will Google be able to get away with labelling Chrome OS “beta” to start off with? I think that in order to get people to use it, beyond the Google brand name, it will have to be really good, polished, and / or flashy and convincing enough as an initial experience for people to base their computing lives on it. I think it will probably have to have had more testing than many of the existing Google cloud web products.

Final thought

Right now, all we can really say is: “well, this is interesting”. We can speculate, but frankly, I don’t think we know enough to say anything more. That’s all I’m sayin’.