Digital Developer Conference: Hybrid Cloud. On Sep 22 & 24, start your journey to OpenShift certification. Free registration

IBM Developer Blog

Follow the latest happenings with IBM Developer and stay in the know.

We've created a developer edition of IBM MQ for the smallest platform yet.


The IBM MQ team is sometimes asked if MQ can run anywhere other than large enterprise systems, like a mainframe. The answer is always a resounding “yes!” IBM MQ supports a wide range of platforms, but to make life easier for developers, we have developer builds for Windows and Linux, a Mac client, our MQ on Cloud managed service, and an IBM MQ container image. (You can learn more about these developer platforms on our “Get started with IBM MQ” page.)

Now, we’ve created a developer edition of IBM MQ for the smallest platform yet. Introducing… the IBM MQ Developer Edition for Raspberry Pi OS!

The Raspberry Pi is a tiny computer about the size of a credit card that’s more than powerful enough to run MQ. They’re often used as part of DIY computing projects and as educational tools. For example, our MQ Developer Experience team used two $12 Raspberry Pi Zeros to run an image transfer demo to show system resilience to developers at several conferences:

Photograph of a Raspberry Pi Zero

The above image shows an early prototype of the image transfer demo. Here, photos are taken and sent through a queue manager on one of the Raspberry Pis. The other waits on standby in case there is a fault (which we inject) that knocks out the first Pi. The other Pi then takes those messages instead, showing that even if a server goes down, we can still get the data through!

We’re offering the IBM MQ Developer Edition for Raspberry Pi OS for MQ version 9.2. The version we offer will be updated with every MQ release.

Why do I want IBM MQ on my Pi?

MQ makes the process of connecting multiple applications a lot simpler, safer, and more scalable. It’s controlled through an easy-to-manage console or via the command line interface, MQSC.

If you’re new to messaging, have a look at this quick introduction. If you want a qualification to show off your messaging proficiency, follow this IBM MQ learning path.

So, what can I do with it?

Quite a lot, as it turns out! Most of the features of our software that are used to power the world’s biggest companies are also available to use on your Pi at home. This includes stuff like multi-instance queue managers and queue manager clustering. For anyone with a Raspberry Pi 3 and up (on the ARM7 architecture), you can also take advantage of fully functional TLS authentication.

Let’s get it working!

First, download the build from here. To install it, follow the steps in this get connected with MQ tutorial – it’s aimed at Ubuntu users but the steps will also work on Raspberry Pi OS since they’re both Debian-based systems.

After you’ve installed MQ and configured your environment, your dspmqver command should show you that this build is the 32-bit developer build for the ARM platform, running on Raspbian.

Output of the dspmqver command

As explained in the tutorial, don’t forget to set up your environment, create and configure a queue manager, and authorize access for your applications – otherwise, you won’t be able to put and get messages!

Activating the MQ Console

Once you’re done, we can activate the MQ Console, which is a powerful tool used to create and edit MQ objects such as queues. You can also see the messages on each queue you control, and much more. You can also make administrative changes to your MQ software this way. We’ll do this now.

For the Pi build, we need to configure local OS authentication for the console user. If you’re used to the MQ Console on other platforms, these steps are different, but necessary.

First, we create a user called “mqadmin”.

sudo adduser mqadmin

Remember to set a password that you will remember because you’ll need it to sign into the console once it’s enabled.

You can paste the code below as one block to achieve the desired result. Below, we add our new user to the group called “mqm” (you created this group as part of the installation process in the Ubuntu tutorial). You should see that “mqadmin” was added to the group “mqm”.

Next, we will copy the file local_os_registry.xml from the web samples directory and edit it to activate the console, with local OS authentication for security. This will copy over the file and list the contents of the directory. In the /var/mqm/web/installations/Installation1/servers/mqweb directory, there is a file named mqwebuser.xml. We rename this to mqwebuser.xml.old, then we rename the local_os_registry.xml file to be the new mqwebuser.xml file.

sudo adduser mqadmin mqm
groups mqadmin

cd /opt/mqm/web/mq/samp/configuration
cp local_os_registry.xml /var/mqm/web/installations/Installation1/servers/mqweb
cd /var/mqm/web/installations/Installation1/servers/mqweb
ls

mv mqwebuser.xml mqwebuser.xml.old
mv local_os_registry.xml mqwebuser.xml

Now, edit the mqwebuser.xml file. You can use nano, vi, or any other text editor.

sudo nano mqwebuser.xml

Uncomment the lines containing the httpsPort and httpHost variables. Uncommenting the httpsPort variable allows the console to be reached on the port 9443. Uncommenting the httpHost variable allows connections from locations other than localhost (yes, you can use the MQ Console from your phone!)

The file should now look something like this after the above edit. In the nano editor below, you can see the lines which have been uncommented:

Screen shot of the mqwebuser.xml file in an editor

Finally, let’s start the MQ web server that hosts the console. Once we’ve done this, everything should fall into place. Set the server running with this command:

strmqweb

And that’s it! Your console should be working. To access the MQ console, go to

[network-ip-address-of-your-Raspberry-Pi]:9443/ibmmq/console

In your internet browser. You may get a warning, but it’s okay to proceed here as it refers to a self-signed certificate being used as part of your local authentication. Once you get to the sign-in page, sign in with the username “mqadmin” and the password you set for the admin account.

Once you’re signed in, there’s helpful information to help you get the most out of MQ and view and create queues and manage messages and permissions.

Screen shot of IBM MQ Console welcome screen

Viewing your queue manager

Click the Manage item to view and edit your MQ installation. Selecting your queue manager brings you to the below page, which allows you to view queues, topics, subscriptions and channels for your queue manager. By selecting a queue, you can view more information about it, put messages and edit its properties!

Screen shot of IBM MQ queue manager screen

Important note about IBM MQ Developer Edition for Raspberry Pi OS

If you’re new to MQ, there are a few things you should be aware of. Firstly, this is a developer edition of our software, so it’s definitely not suitable for use in production. Also, it’s an experimental offering, so it’s provided “as-is”, with no formal support (however, there is a GitHub repo for reporting issues). Lastly, some MQ features may not be available.

If you’re an MQ pro (or just love detail), more Pi-specific limitations can be found in the downloaded folder at /READMES/RPi_README.txt. If you’ve already installed MQ, you can also find the file here: /opt/mqm/RPi_README.txt.

So, what’s next?

Now, you’re ready to write some MQ applications. Follow this tutorial to get started with creating a simple Java application. If you want some sample code for a specific language, feel free to use samples from our Github repo.

If you come across any issues, please raise them on our GitHub repo here: https://github.com/ibm-messaging/mq-raspberry-pi-developers.

We’d love to see what you create with MQ. Happy making!