Summer days, steam … and MQ publish/subscribe
PeterHayward 06000023AU Visits (4459)
The advent of summer, well the best that England can usually manage, means that for me and a few like-minded souls, I can get outside and (I'll say this very quietly!) play with model railway steam engines. Well, they say that getting old is inevitable, but growing up is optional…
A couple of days ago, a newsletter related to my chosen time-waster arrived in the mail with a reminder that it was time to renew my subscription. Easy enough for a publication that's sent to just a few hundred subscribers. I can contact the editor directly and give him a credit card number over the phone – and have a nice chat while we're about it.
I can similarly make direct contact with the producers of several other magazines and journals that I receive. However, I also belong to an international hobby association with a membership of many thousands. Dealing with magazine subscriptions there gets a bit more formal. I have to go through the membership department, and I no longer have direct contact with the guy who produces the magazine. At least I'm still dealing with the same organization, though.
But the television listings magazine that we as a family subscribe to, with its circulation of millions, is at yet another level. For that, we have to go through a company that simply handles subscriptions for many popular magazines: no contact with the publishers at all.
So what? That's just the way these things work. But it struck me as I sit here writing for an IBM Redbooks publication about what's new in IBM MQ version 8, that it's also pretty much how publish/subscribe works these days.
You might think of my communication with the editor of my small-circulation newsletter in terms of a straightforward MQ message sent direct from me to him. Job done.
When it gets to the association magazine however, we're getting into the realms of MQ publish/subscribe – the idea that a producer publishes a magazine (in this case) and anybody who might be interested in that subject can flag up their interest and be sent a copy whenever a new edition is published.
When it comes to clusters in MQ, that's pretty much how it's worked up to now, the "magazine" goes straight from the publisher to every subscriber. It's quick and easy, and means that the communication is always direct.
However, it also means that everyone (I mean every queue manager in the cluster, in MQ terms) has to be aware of what's going on, which can be a bit of a waste. Most people most of the time won't be interested in publications about model steam locos. (We're a very select band, after all!) There comes a point in a huge cluster when all that extra information flying about just slows things down too much.
Hence the new mode of working in MQ V8 clusters. The established way of doing publish/subscribe is now known as "direct" routing to distinguish it from the new "topic host" routing. In MQ you can either set the mode by using MQ Explorer, or by using the new CLROUTE parameter on the MQSC command DEFINE TOPIC to set the mode to either DIRECT or TOPICHOST.
Topic host routing is more like my subscription to the television listings magazine, where I subscribe through an intermediary who gets the magazines from the publisher and forwards them on to all the subscribers. In the world of MQ, that means it's only the intermediary (the topic host queue manager) that has to be aware of everyone else, which makes it much more scalable and cuts down on all those messages between queue managers. The pay-back is, of course, that to deliver a publication now takes two steps; from publisher to topic host, and then on to subscriber. But even that can sometimes be offset by putting the topic host and a major publisher on the same queue manager.
Furthermore, just as in the real world where there is, in fact, more than one magazine distributor, there's no reason why you can't have more than one topic host in a cluster, to share the load and mitigate against failure if one host becomes unavailable. The difference here, perhaps, is that topic hosts in MQ are designed to cooperate, whereas magazine suppliers tend to be in competition!
The new IBM Redbooks publication, IBM WebSphere MQ V8 Features and Enhancements (currently available as a draft publication as of 1 July 2014) won't tell you much about magazine distribution, and even less about railway steam engines (more's the pity) but if you need to know about the new ways of doing publish subscribe, not to mention the other new "features and enhancements", it's worth getting hold of a copy. Once the publication is out of draft mode, the same URL will be used for the final publication.
title image (modified) credit: Peter Hayward